I’m building a website for my new company and want to create a landing page for my product that doesn’t have a nav bar or a footer. I want to keep the landing page simple and just focus on the product.
I’m coding in Ruby on Rails. Twitter Bootstrap is what I’m using for styling the nav bar and footer.
My home page and about page have a nav bar and footer, but I don’t want my product landing page to have the nav bar and footer.
Any suggestions on how I can hide the nav bar and footer on my landing page, but keep it on my other pages?
4
Answers
Yes , you can do it . One easy way is to use a different layout file for the landing page controller other than the default
application.html.erb
. In your desired template page write a custom layout name which will hold up the different kinds of specification . Let me give an example ,Thanks . Hope this one way will solve your problem .
Visit This link for more information . ActionView API Docs
To add to
code.prio
‘s answer, you could just use a conditional statement in yourapplication
layout (saves the hassle of maintaining two layouts):Not as pretty as the other answer, but works better. If you have more than one layout, it gets annoying having to maintain them both.
I had the same problem, and I solved it this way:
using
action_name
instead ofcontroller_name
.It’s very simple: