diff --git a/README.md b/README.md index c0c0e8e..8e2a64b 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,40 @@ Roberto Decurnex (nex.development@gmail.com) ## Install If you are using Bundler you can easily add the following line to your Gemfile: + gem 'rack-jsonp-middleware' Or you can just install it as a ruby gem by running: + $ gem install rack-jsonp-middleware +## Configuration + +### Rails 3 + +In your `config/application.rb` file add: + + require 'rack/jsonp' + +And, within the config block: + + config.middleware.use Rack::JSONP + +Here is an exelent example of this - [Rails 3 Configuration Example](https://github.com/rwilcox/rack_jsonp_example/commit/809c2e3d4470b694ba1a98c09f2aa07115f433e5 "Rails 3 Configuration Example") + +Thank you [rwilcox](https://github.com/rwilcox "rwilcox profile")! + +### Rails 2 + +Same as for Rails 3 but modifying the `config/environment.rb` file instead. + +### Rack Apps + +In your `config.ru` file add the following lines: + + require 'rack/jsonp' + use Rack::JSONP + ## Download You can also clone the project with Git by running: