2

So, I'm using twitter-bootstrap-rails and this gem has a nav_bar helper method that is being loaded automatically. But if I want to use this helper method method in a namespaced view I get the error message undefined method nav_bar:

# views/admin/shared/_menu.html.erb
<%= nav_bar fixed: :top, brand: 'AdminArea', responsive: true do %>
  <%= menu_group do %>
    <%= menu_item 'Articles', admin_articles_url %>
  <% end %>
<% end %>

So I guess, since the view is being rendered in a namespaced controller the helper method is not being recognized since the helper method is in the "regular" application namespace? How do I fix this?

Vapire
  • 4,568
  • 3
  • 24
  • 41
  • Instead of using helper methods, isn't it easier to just follow the Bootstrap documentation and apply the styles yourself? There is no need for a gem to do this, I believe. – amb110395 May 20 '13 at 13:38

1 Answers1

2

I had the same problem until I used the latest gem directly from git. Put the following in your Gemfile:

gem "twitter-bootstrap-rails", :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

Solves the problem for me.

RonanOD
  • 876
  • 1
  • 9
  • 19