Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

pjax for rails and rack applications

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rack-pjax.gemspec

Rack-pjax stillmaintained travis

Rack-pjax is middleware that lets you serve 'chrome-less' pages in respond to pjax-requests.

It does this by simply filtering the generated page; only the title and inner-html of the pjax-container are sent to the client.

While this won't save you any time rendering the page, it gives you more flexibility where or how to define the pjax-container. Ryan Bates featured rack-pjax on Railscasts and explains how this gem compares to pjax_rails.


Check out the Railscast notes how to integrate rack-pjax in your Rails 3.1 application.

The more generic installation comes down to:

I. Add the gem to your Gemfile

    # Gemfile
    gem "rack-pjax"

II. Include rack-pjax as middleware to your application(-stack)

    require ::File.expand_path('../config/environment',  __FILE__)
    use Rack::Pjax
    run RackApp::Application

III. Install jquery-pjax. Make sure to add the 'data-pjax-container'-attribute to the container.

      <script src="/javascripts/jquery.js"></script>
      <script src="/javascripts/jquery.pjax.js"></script>
      <script type="text/javascript">
      <div data-pjax-container>

IV. Fire up your pushState-enabled browser and enjoy!


  • Hpricot


  • eval
  • matthooks
Something went wrong with that request. Please try again.