mirror of
https://github.com/pry/pry-rails.git
synced 2022-11-09 12:36:03 -05:00
Fix find-route under Rails 3.0 and 3.1
This commit is contained in:
parent
441341c6c5
commit
520e39385d
1 changed files with 3 additions and 2 deletions
|
@ -54,7 +54,8 @@ class PryRails::FindRoute < Pry::ClassCommand
|
|||
result << "Routes for " + text.bold(controller.camelize + "Controller") + "\n"
|
||||
result << "--\n"
|
||||
routes.each do |route|
|
||||
result << "#{route.defaults[:action]} #{text.bold(verb_for(route))} #{route.path.spec}" + "\n"
|
||||
spec = route.path.is_a?(String) ? route.path : route.path.spec
|
||||
result << "#{route.defaults[:action]} #{text.bold(verb_for(route))} #{spec}" + "\n"
|
||||
end
|
||||
result << "\n"
|
||||
end
|
||||
|
@ -65,7 +66,7 @@ class PryRails::FindRoute < Pry::ClassCommand
|
|||
end
|
||||
|
||||
def verb_for(route)
|
||||
%w(GET PUT POST PATCH DELETE).find { |v| route.verb =~ v }
|
||||
%w(GET PUT POST PATCH DELETE).find { |v| route.verb === v }
|
||||
end
|
||||
|
||||
def single_action?(controller)
|
||||
|
|
Loading…
Reference in a new issue