Created
August 1, 2012 03:00
-
-
Save pda/3223226 to your computer and use it in GitHub Desktop.
Revisions
-
pda created this gist
Aug 1, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # Support for HTTP PATCH. # Should not be necessary as of Rails 4. # See: actionpack/lib/action_dispatch/routing/mapper.rb module ActionDispatch module Routing class Mapper module HttpHelpers # Define a route that only recognizes HTTP PATCH. # For supported arguments, see <tt>Base#match</tt>. # # Example: # # patch 'bacon', :to => 'food#bacon' def patch(*args, &block) map_method(:patch, *args, &block) end end end end end # See: actionpack/lib/action_dispatch/testing/integration.rb module ActionDispatch module Integration module RequestHelpers # Performs a PATCH request with the given parameters. See +#get+ for more # details. def patch(path, parameters = nil, headers = nil) process :patch, path, parameters, headers end end end end