<img src=“https://badge.fury.io/rb/rails-ajax.png” alt=“Gem Version” /> <img src=“http://inch-ci.org/github/Muriel-Salvan/rails-ajax.png” alt=“Inline docs” /> <img src=“https://travis-ci.org/Muriel-Salvan/rails-ajax.png?branch=master” /> <img src=“https://codeclimate.com/github/Muriel-Salvan/rails-ajax.png” /> <img src=“https://codeclimate.com/github/Muriel-Salvan/rails-ajax/coverage.png” /> <img src=“https://gemnasium.com/Muriel-Salvan/rails-ajax.svg” alt=“Dependency Status” /> <img src=“https://pledgie.com/campaigns/24808.png?skin_name=chrome” alt=“Click here to lend your support to: rails-ajax and make a donation at pledgie.com !” border=“0” />
Integrate Ajax capabilities to Rails websites with history, bookmarking, partial refreshes, Rails flashes, user callbacks, scripts execution, redirections.
Rails-Ajax is a Rails plugin that turns a static Rails website into an optimized one using Ajax, without altering the user experience and with minimal code changes.
rails-ajax is packaged as a Ruby gem. Use it in your Rails project by adding it to your Gemfile:
gem 'rails-ajax'
Once installed, some configuration files need to be generated:
rake rails-ajax:install
Edit the generated config files to your taste. Most importantly, identify the container that should be refreshed by Ajax calls, and set it in config/initializers/rails-ajax-config.rb:
main_container 'div#Content'
Include rails-ajax Javascript files in your asset pipeline (app/assets/javascripts/application.js):
// RailsAjax
//= require jquery.history
//= require jquery.rails-ajax
//= require RailsAjax-Config
Just restart your Rails server and your application should be working using Ajax calls to refresh just your main site container, with history, redirects, forms… working exactly the same way they did before.
For more advanced features, see its home page.
Check the AUTHORS file.
BSD - You can find in the LICENSE file.