Rails - making linked views display without layouts/application.html.erb contents
I'm sorry if this is confusing but in my layouts/application.h开发者_Python百科tml.erb I have several links, e.g to logout (logout_path). My application.html.erb has all of its contents inside a div called 'container' and when I link to another page e.g login the contents of that view are displayed inside the 'container' div. and when I link to another page which contains several divs which are supposed to fill the browser, that page is squashed into the container div, while other elements from my layouts page are displayed e.g footer. How can I get the contents of my login and the contents of some of my other linked pages not to display inside the div in application.html.erb?
Sorry that this is so confusing.
For any action that you want to render without using a layout you can add render :layout => false
in the controller. For example, if you have a SessionsController
class SessionsController < ApplicationController
def login
render :layout => false
end
end
精彩评论