Skip to content

mynyml/rack-js4xhr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===== Summary

As it is highly common to want to return javascript from an ajax request, this
rack middleware will set the application/javascript media type on xhr requests.

If the 'X-Requested-With' header is present, 'application/javascript' will be
prepended to the Accept header, available as env['HTTP_ACCEPT'].

===== Install

  sudo gem install mynyml-rack-js4xhr --source=http://gems.github.com/

===== Usage

  require 'rack'
  require 'rack/js4xhr'

  use Rack::Js4Xhr
  run App.new

===== Links

source:: http://github.com/mynyml/rack-js4xhr
rdocs::  http://docs.github.com/mynyml/rack-js4xhr

About

Rack middleware to set application/javascript media type on xhr requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages