In the body of application.html.erb
I have:
<%= render 'layouts/header'%>
<%= yield %>
<%= render 'layouts/footer'%>
On a certain view, I want to remove the footer partial, or otherwise have it not show up on the view. How should I do this?
You can set the condition below for rendering your partial.
<%= render 'layouts/header'%>
<%= yield %>
<% unless controller_name=="sessions" && action_name=='new' %>
<%= render 'layouts/footer'%>
<%end%>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.