Installieren von jQuery in Rails 3.2.13

Ich habe Probleme, jQuery dazu zu bringen, an Ruby on Rails 3.2.13 zu arbeiten. Ich habe mir Tutorials angesehen, nach YouTube usw. gesucht und kann es immer noch nicht zum Laufen bringen.

Insbesondere habe ich Probleme bei der Verwendung von jQuery ui. Ich kann das Akkordeon Widget nicht zum Laufen bringen. Ich kann nicht einmal eine einfache jQuery (wie das Anzeigen einer Hallo-Warnmeldung) für die Arbeit an ROR veranlassen.

Ihre Hilfe wird gerne in Anspruch genommen. Vielen Dank!

Hier ist meine application.html.erb-Datei:

 <!DOCTYPE html>
    <html>
    <head>
      <title>TestProj</title>
      <%= stylesheet_link_tag    "application", :media => "all" %>
      <%= javascript_include_tag "application" %>
      <%= csrf_meta_tags %>
    </head>
    <body>

    <%= yield %>

    </body>
    </html>

Hier ist meine Gem-Datei:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

Ihre ist meine application.js Datei:

// 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
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .


$(document).ready(function() {
 alert('Thanks for visiting!');
});

Antworten auf die Frage(2)

Ihre Antwort auf die Frage