Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A gem to automate using jQuery with Rails

License

NotificationsYou must be signed in to change notification settings

rails/jquery-rails

Repository files navigation

jQuery! For Rails! So great.

This gem provides:

  • jQuery 1, 2 and 3
  • the jQuery UJS adapter
  • assert_select_jquery to test jQuery responses in Ruby tests

Versions

Starting with v2.1, the jquery-rails gem follows these version guidelinesto provide more control over your app's jQuery version from your Gemfile:

patch version bump = updates to jquery-ujs, jquery-rails, and patch-level updates to jQueryminor version bump = minor-level updates to jQuerymajor version bump = major-level updates to jQuery and updates to Rails which may be backwards-incompatible

SeeVERSIONS.md to see which versions of jquery-rails bundle whichversions of jQuery.

Installation

Add

gem 'jquery-rails'

to your Gemfile.

The jquery and jquery-ujs files will be added to the asset pipeline and available for you to use. If they're not already inapp/assets/javascripts/application.js by default, add these lines:

//= require jquery//= require jquery_ujs

If you are running Rails 5.1 and up, and if you have included//= require rails-ujs, thenjquery_ujs is not needed anymore. You can just add:

//= require jquery

If you want to use jQuery 2, you can requirejquery2 instead:

//= require jquery2//= require jquery_ujs

And if you want to use jQuery 3, you can requirejquery3:

//= require jquery3//= require jquery_ujs

For jQuery UI, we recommend thejquery-ui-rails gem, as it includes the jquery-ui css and allows easier customization.

As of v3.0, jquery-rails no longer includes jQuery UI. Use thejquery-ui-rails gem above.

Contributing to jquery-rails

jquery-rails is work of many contributors. You're encouraged to submit pull requests, proposefeatures and discuss issues.

  • If it's an issue pertaining to the jquery-ujs javascript, please report it to thejquery-ujs project.

  • If the jQuery scripts are outdated (i.e. maybe a new version of jquery was released yesterday), feel free to open an issue and prod us to get that thing updated. However, for security reasons, we won't be accepting pull requests with updated jQuery scripts.

SeeCONTRIBUTING.

License

jquery-rails is released under theMIT License.

Acknowledgements

Many thanks are due to all ofthe jquery-rails contributors. Special thanks toJangoSteve for tirelessly answering questions and accepting patches, and theRails Core Team for making jquery-rails an official part of Rails 3.1.

About

A gem to automate using jQuery with Rails

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors69

Languages


[8]ページ先頭

©2009-2025 Movatter.jp