简体   繁体   中英

does rails 3.1 download jquery and jquery ui files if specified in the asset pipeline?

does rails 3.1 download jquery and jquery ui files if specified in the asset pipeline? I have the gems installed and my application.js is as below Do I need to copy jquery manually into the pipeline?

gem file :

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# 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.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
  gem 'jquery-rails'
  gem 'jquery-ui-rails'
end

#gem 'jquery-rails'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

Layout:

<!DOCTYPE html>
<html>
<head>
  <title>Depot31</title>
  <%= stylesheet_link_tag    "application" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>

Application.js

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require_tree .

Asset pipeline takes care of this if you to add following lines into your Gemfile:

gem "jquery-rails"
gem 'jquery-ui-rails'

check jquery-rails and jquery-ui-rails for more information how to setup this gems

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM