Skip to content
Add Ajax capabilities to Rails websites, with minimal code changes. Supports history, bookmarking, partial refreshes, Rails flashes, user callbacks, scripts execution, redirections. Built upon Rails-UJS and jQuery.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Distribution
assets/javascripts
examples
gen
lib
tasks
test
.gitignore
.hound.yml
.metrics
.travis.yml
AUTHORS.rdoc
ChangeLog
Credits
Gemfile
LICENSE
README.rdoc
Rakefile
rails-ajax.gemspec
reek.yml

README.rdoc

Gem Version Inline
docs Dependency
Status Click
here to lend your support to: rails-ajax and make a donation at pledgie.com
!

Rails-Ajax

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.

Basic install

rails-ajax is packaged as a Ruby gem. Use it in your Rails project by adding it to your Gemfile:

gem 'rails-ajax'

Basic usage

Generate configuration files

Once installed, some configuration files need to be generated:

rake rails-ajax:install

Edit configuration files

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 Javascript files

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

It already works

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.

Who contributed to it ?

Check the AUTHORS file.

What is the license ?

BSD - You can find in the LICENSE file.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.