Created
February 3, 2014 23:11
-
-
Save jessecurry/8794329 to your computer and use it in GitHub Desktop.
Respond to a custom HTTP method in a Rails App
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
Example::Application.routes.draw do | |
# TRIFORCE /youcant | |
match :youcant, to: "youcant#triforce", via: :triforce | |
end |
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
# This will allow you to TRIFORCE | |
%w(triforce).each do |method| | |
ActionDispatch::Request::HTTP_METHODS << method.upcase | |
ActionDispatch::Request::HTTP_METHOD_LOOKUP[method.upcase] = method.to_sym | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment