Created
September 5, 2013 02:12
-
-
Save mryoshio/6445258 to your computer and use it in GitHub Desktop.
Have rails respond to HTTP OPTIONS method.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implementation for HTTP OPTIONS method in rails 3.2.13 | |
# inspired by https://gist.github.com/ajturner/832700 | |
# routes.rb | |
match '/*any_path', :controller => 'application', :action => 'method_for_options_method', :constraints => { :method => 'OPTIONS' } | |
# application_controller.rb | |
def method_for_options_method | |
render :nothing => true, :status => 200 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment