Rails: How to determine controller/action in view

前端 未结 5 1565
半阙折子戏
半阙折子戏 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:46

    current_page?(action: 'edit')

    See ActionView::Helpers::UrlHelper#current_page?

    Rails also makes the methods controller_path, controller_name, action_name available for use in the view.

提交回复
热议问题