Skip to content

proxy_request is a simple helper to Rails routes. It's usefull for eg. making local Ajax request to remote sites.

Notifications You must be signed in to change notification settings

kamil/proxy_request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxy_request

proxy_request is a simple helper to Rails routes. It's usefull for eg. making local Ajax request to remote sites.

Rails 3.x compatibile

Installation

just add gem to Gemfile:

gem 'proxy_request'

Usage

and in routes.rb, use new helper proxy_request to proxy request to other url

match 'proxy/*all' => proxy_request('http://other.api.com/%{all}')

proxy_request by default validates CSRF protection for every http method ( GET, POST ... ).

To disable it just set :csrf option to false

match 'api/*all' => proxy_request('http://other.api.com/%{all}', :csrf => false )
Copyright

Kamil Załęski, http://kamilzaleski.com

About

proxy_request is a simple helper to Rails routes. It's usefull for eg. making local Ajax request to remote sites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages