简体   繁体   中英

Render layout without application layout in rails 5

I have a simple login form and a some other content which compose the rest of the application. My problem is I want to render the login form alone, then once the user has logged in he/she can see the rest of the app which is composed of the application layout. Thanks in advance.

You can create another layout for the login and in the controller set like this at the top of your controller, specifying the actions that will use the other layout:

layout "full_page", only: [sign_in, sign_up]

Other option is to pass to the render method the layout option:

render layout: "full_page"

For more info check the Rails Guides

http://guides.rubyonrails.org/layouts_and_rendering.html#using-render

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM