Bootstrap for Rails dropdown box not working -
i reading michael hartl's ruby on rails tutorial. in chapter 8 implement sign in , sign out functionality. running bug in sections create "account" dropdown box. of tests pass , have followed code in book verbatim when hover on or click on "account" dropdown box nothing happens.
here _header.erb file:
<header class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <%= link_to "sample app", root_path, id: "logo" %> <nav> <ul class="nav pull-right"> <li><%= link_to "home", root_path %></li> <li><%= link_to "help", help_path %></li> <% if signed_in? %> <li><%= link_to "users", '#' %></li> <li id="fat-menu" class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> account <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><%= link_to "profile", current_user %></li> <li><%= link_to "settings", '#' %></li> <li class="divider"></li> <li> <%= link_to "sign out", signout_path, method: "delete" %> </li> </ul> </li> <% else %> <li><%= link_to "sign in", signin_path %></li> <% end %> </ul> </nav> </div> </div> </header>
and here application.js
//= require jquery //= require bootstrap //= require jquery_ujs //= require_tree .
and gemfile
source 'https://rubygems.org' gem 'rails', '3.2.3' gem 'bootstrap-sass', '2.0.0' gem 'bcrypt-ruby', '3.0.1' # bundle edge rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' group :development, :test gem 'sqlite3', '1.3.5' gem 'rspec-rails', '2.10.0' gem 'annotate', '~> 2.4.1.beta' gem 'guard-rspec', '0.5.5' end # gems used assets , not required # in production environments default. group :assets gem 'sass-rails', '3.2.4' gem 'coffee-rails', '3.2.2' # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', :platforms => :ruby gem 'uglifier', '2.0.0' end gem 'jquery-rails' group :test #gem 'rspec-rails', '2.10.0' gem 'capybara', '1.1.2' gem 'rb-fchange', '0.0.5' gem 'rb-notifu', '0.0.4' gem 'win32console', '1.3.0' gem 'guard-spork', '0.3.2' gem 'spork', '0.9.0' gem 'factory_girl_rails', '1.4.0' end group :production gem 'pg', '0.12.2' end # use activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' # use jbuilder templates json # gem 'jbuilder' # use unicorn app server # gem 'unicorn' # deploy capistrano # gem 'capistrano' # use debugger # gem 'debugger'
i'm new rails i'm not quite sure other information or code best provide.
any ideas or suggestions on how proceed appreciated.
i think problem might solved removing id="fat-menu"
<li id="fat-menu" class="dropdown">
.
Comments
Post a Comment