mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Allow actions which start with A-Za-z_ only
This commit is contained in:
@@ -726,7 +726,7 @@ module ActionDispatch
|
||||
path = options.delete(:path)
|
||||
action = args.first
|
||||
|
||||
if action && action.to_s =~ /^[\w_]+$/
|
||||
if action && action.to_s =~ /^[A-Za-z_]\w*$/
|
||||
path = path_for_action(action, path)
|
||||
options[:action] ||= action
|
||||
options[:as] = name_for_action(action, options[:as])
|
||||
|
||||
@@ -188,7 +188,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
|
||||
resources :sheep
|
||||
resources :sheep do
|
||||
get "_it", :on => :member
|
||||
end
|
||||
|
||||
resources :clients do
|
||||
namespace :google do
|
||||
@@ -996,6 +998,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
||||
assert_equal '/sheep/1', sheep_path(1)
|
||||
assert_equal '/sheep/new', new_sheep_path
|
||||
assert_equal '/sheep/1/edit', edit_sheep_path(1)
|
||||
assert_equal '/sheep/1/_it', _it_sheep_path(1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user