seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 997 forks source link

(How-to) Remove container from navbar helper #794

Closed patrickgordon closed 10 years ago

patrickgordon commented 10 years ago

Got a question on how to do something. If there is a more appropriate place (stackoverflow?) let me know...

How would I go about removing the container in the navbar helper?

Currently this: <%= nav_bar %>

Renders:

<div class="navbar">
    <div class="container">
    </div>
</div>

I'm after something like:

<div class="navbar">
</div>

So instead of: image

It would look something like image

Thanks for any help in advance. Absolutely love this gem. Top notch.

toadkicker commented 10 years ago

You can pass a block and override it:

https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/navbar_helper.rb#L115

patrickgordon commented 10 years ago

Yep.. On the train this morning I was like "oh wait..." I shouldn't code late at night. Thanks again mate.

edit: for anyone else you just make the navbar have :fluid => true

e.g. <%= nav_bar :fixed => :top, :brand => "Example", :responsive => true, :fluid => true do %>