Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bypass application.html.erb in Rails app

Tags:

I have an application.html.erb file which sets out layout for every pages in my app (header, footer etc.) like a typical Rails app.

However, I would like to have a landing page which I don't want to use this file. How should I bypass application.html.erb?

Thank you.

like image 328
AdamNYC Avatar asked Mar 05 '12 00:03

AdamNYC


1 Answers

Use

render :layout => false 

or

render :layout => 'whatever' 

in your action. If you are using a separate LandingController you simply can create a app/views/layouts/landing.html.erb which will be picked up or you can override the layout via

class LandingController < ApplicationController   layout 'whatever'   ... end 
like image 108
iltempo Avatar answered Nov 27 '22 12:11

iltempo