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?
To add to code.prio
's answer, you could just use a conditional statement in your application
layout (saves the hassle of maintaining two layouts):
#app/views/layouts/application.html.erb
<% unless controller_name == "landing" %>
... navbar ...
<% end %>
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.
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 ,
class SiteController < ApplicationController
layout "landing_page"
...
end
This will load up a different layout with different view as you want for your site , while the default layout can hold the basic navbar and products for other pages.
Thanks . Hope this one way will solve your problem .
Visit This link for more information . ActionView API Docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With