Rails: How to determine controller/action in view

前端 未结 5 1568
半阙折子戏
半阙折子戏 2021-01-31 17:10

This is my form partial:

<%= f.simple_fields_for :photo_attributes, :html => { :multipart => true } do |d| %>
    <%= d.label :image, :label =>         


        
5条回答
  •  遇见更好的自我
    2021-01-31 17:42

    Generally the form partial only contains the fields, not the form tag or the fields for, but if you have no other way, you can always see what params[:action] is currently set to and behave accordingly.

提交回复
热议问题