Rails: Xhr requests(read: ajax requests) stay Xhr even if they are redireted
Ruby
Switch branches/tags
Nothing to show
Latest commit 561c5c0 Feb 28, 2011 @grosser gemfile-ify
Permalink
Failed to load latest commit information.
lib tests and refactoring Nov 12, 2009
test rails 3 compatability Dec 23, 2009
Gemfile gemfile-ify Feb 28, 2011
Gemfile.lock gemfile-ify Feb 28, 2011
Rakefile refactor tests a bit Nov 18, 2009
Readme.md update readme Feb 28, 2011
init.rb make include more intelligent, and not rely on Rails Nov 12, 2009

Readme.md

With xhr_redirect redirected xhr requests (read: ajax requests) stay xhr --> request.xhr? == true

Details

  • When an xhr request is redirected, _xhr=1 will be added to the parameters
  • Request with _xhr=1 are recognised as xhr ( also enhances testablility, simulate xhr responses by adding _xhr=1 )

Install

script/plugin install git://github.com/grosser/xhr_redirect.git

TODO

  • find a more elegant solution

Author

Michael Grosser
michael@grosser.it
Hereby placed under public domain, do what you want, just do not hold me accountable...