Skip to content

Commit

Permalink
Documents that automatic PJAX behavior is no longer the default
Browse files Browse the repository at this point in the history
  • Loading branch information
alindeman committed Jul 12, 2012
1 parent 4dcc3cd commit d659e0a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ To activate, add this to your app/assets/javascripts/application.js (or whatever

//=require jquery.pjax

All links that match `$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])')` will then use PJAX.
In previous versions of `pjax_rails`, most links would automatically use PJAX.
However, this was found to be too inflexible; instead, the types of links you
want to exhibit PJAX should be explicitly enabled:

The PJAX container has to be marked with data-pjax-container attribute, so for example:
# app/assets/javascripts/application.js
$(function() {
$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]');
});

For this example, the PJAX container has to be marked with data-pjax-container
attribute, so for example:

<body>
<div>
Expand Down

0 comments on commit d659e0a

Please sign in to comment.