mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stop splatting so much. We don't need ⭐args everywhere
This commit is contained in:
parent
cb6ccadceb
commit
90410b4c3a
1 changed files with 6 additions and 7 deletions
|
@ -464,7 +464,7 @@ module ActionDispatch
|
|||
#
|
||||
# get 'bacon', :to => 'food#bacon'
|
||||
def get(*args, &block)
|
||||
map_method(:get, *args, &block)
|
||||
map_method(:get, args, &block)
|
||||
end
|
||||
|
||||
# Define a route that only recognizes HTTP POST.
|
||||
|
@ -474,7 +474,7 @@ module ActionDispatch
|
|||
#
|
||||
# post 'bacon', :to => 'food#bacon'
|
||||
def post(*args, &block)
|
||||
map_method(:post, *args, &block)
|
||||
map_method(:post, args, &block)
|
||||
end
|
||||
|
||||
# Define a route that only recognizes HTTP PUT.
|
||||
|
@ -484,7 +484,7 @@ module ActionDispatch
|
|||
#
|
||||
# put 'bacon', :to => 'food#bacon'
|
||||
def put(*args, &block)
|
||||
map_method(:put, *args, &block)
|
||||
map_method(:put, args, &block)
|
||||
end
|
||||
|
||||
# Define a route that only recognizes HTTP PUT.
|
||||
|
@ -494,15 +494,14 @@ module ActionDispatch
|
|||
#
|
||||
# delete 'broccoli', :to => 'food#broccoli'
|
||||
def delete(*args, &block)
|
||||
map_method(:delete, *args, &block)
|
||||
map_method(:delete, args, &block)
|
||||
end
|
||||
|
||||
private
|
||||
def map_method(method, *args, &block)
|
||||
def map_method(method, args, &block)
|
||||
options = args.extract_options!
|
||||
options[:via] = method
|
||||
args.push(options)
|
||||
match(*args, &block)
|
||||
match(*args, options, &block)
|
||||
self
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue