11155
(-- --)
July 27, 2014, 4:51pm
1
I am using Ruby 1.9.3 and Rails 3.2.16.
My bootstrape dropdown menu not working. I have no idea why?
Gemfile contain:
ruby "1.9.3"
gem 'rails', '3.2.16'
gem 'bootstrap-sass', '2.1'
gem "watu_table_builder", :require => "table_builder", :git =>
"git://github.com/watu/table_builder.git"
gem 'bcrypt-ruby', '3.0.1'
group :development, :test do
gem 'sqlite3', '1.3.5'
end
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
gem 'jquery-ui-rails'
end
gem 'jquery-rails'
gem 'jquery_datepicker', '~> 0.4'
group :production do
gem 'pg', '0.12.2'
end
Code of application.js:
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap-dropdown
//= require bootstrap
//= require jquery
//= require_tree .
I have taken reference of
[this]ruby on rails - twitter bootstrap drop down suddenly not working - Stack Overflow
link. But this problem does not solve.
Could you help me on this?
Kind regards.
Does the javascript console ( F12 ) show any errors ?
11155
(-- --)
July 28, 2014, 6:44am
3
Sampath Weerasinghe wrote in post #1153678:
Does the javascript console ( F12 ) show any errors ?
When I used code in application.js as per javascript load order like as
follow:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap
//= require_tree .
I got error in javascript console like:
" Uncaught Error: jquery-ujs has already been loaded! ".
11155
(-- --)
July 28, 2014, 12:02pm
4
I have solved this issue.
I add following code in users.js.coffee:
jQuery ->
$('.dropdown-toggle').dropdown()
Hello there,
I have gone through your query which is very commonly found nowadays so I have created a path for you which I hope might get worked in your case.
As Ruby 1.9.3 and Rails 3.2.16 are quite old now so you should consider upgrading to more recent versions to benefit from security updates and improved compatibility. If this doesn’t help too you can take reference from GitHub - roberrttt/ruby-on-rails
Thanks
Zach Tyson