Answer the question
In order to leave comments, you need to log in
Why doesn't jQuery work in a Rails web application?
I decided to include jQuery in my Rails web application. First, I added the following line to the Gemfile: gem 'jquery-ui-rails ', because the gem 'jquery-rails' was already there. After that, I installed the gem with the bundle install command . After we add a line with our new library to the app/assets/javascripts/application.js file: //= require jquery.ui.effect-blind
Next, we move on to the most important thing, here is the code that should be executed completely, but does it partially.
$('#current_item').css({'background-color':'#88ff88'}).animate({'background-color':'#114411'}, 1000);
.animate({'background-color':'#114411'}, 1000)
$('#cart').show('blind', 1000);
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= ruquire jquery.ui.effect-blind
//= require jquery_ujs
//= require turbolinks
//= require_tree .
Answer the question
In order to leave comments, you need to log in
In the latest version of the jquery-ui-rails gem, the file naming scheme has changed. Example:
link to Github , you can read about it there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question