Skip to content

Instantly share code, notes, and snippets.

@ajturner
Created February 17, 2011 21:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ajturner/832700 to your computer and use it in GitHub Desktop.
Save ajturner/832700 to your computer and use it in GitHub Desktop.
make Rails respond to an HTTP OPTIONS method request
# Add to routes.rb
# Needed for responding to OPTIONS http method
map.connect '*path',
:controller => 'home',
:action => 'options_for_mopd',
:conditions => {:method => :options}
# in home_controller.rb
def options_for_mopd
render :nothing => true, :status => 200
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment