public
Last active

make Rails respond to an HTTP OPTIONS method request

  • Download Gist
OPTIONS.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.