ruby - Conditionally render partials in application layout -
in rails 3 application layout include partial flash messages. while ok in cases, there view need flash messages appear in place; there way in layouts/application.html.erb
<%= render 'layout/messages' unless somecondition %>
where somecondition able detect in 'myview/index'?
sure is, use should use params[:controller]
, params[:action]
controller_name
, action_name
per rails documentation
<%= render 'layout/messages' if controller_name == 'myview' && action_name == 'index' %>
Comments
Post a Comment