Permalink
Browse files

need to merge params back in

  • Loading branch information...
1 parent 416e936 commit e54f3696de0f27cba1109abad1a93821107fd97a @joshbuddy committed Jan 24, 2010
Showing with 6 additions and 3 deletions.
  1. +2 −1 lib/usher/interface/rails23.rb
  2. +4 −2 tasks/routes.rake
@@ -68,7 +68,8 @@ def call(env)
def recognize(request)
response = @router.recognize(request)
request.path_parameters.merge!(response.destination)
- "#{request.path_parameters[:controller].camelize}Controller".constantize
+ request.path_parameters.merge!(response.params_as_hash)
+ "#{response.destination[:controller].camelize}Controller".constantize
end
def reset!(options={})
View
@@ -23,13 +23,15 @@ override_task :routes => :environment do
verb = route.conditions && route.conditions[:method].to_s.upcase || ''
path = route.original_path
reqs = route.requirements.blank? ? "" : route.requirements.inspect
- {:name => name, :verb => verb, :path => path, :reqs => reqs}
+ dests = route.destination.inspect
+ {:name => name, :verb => verb, :path => path, :reqs => reqs, :dests => dests}
end
name_width = routes.collect {|r| r[:name]}.collect {|n| n.length}.max
verb_width = routes.collect {|r| r[:verb]}.collect {|v| v.length}.max
path_width = routes.collect {|r| r[:path]}.collect {|s| s.length}.max
+ dests_width = routes.collect {|r| r[:dests]}.collect {|s| s.length}.max
routes.each do |r|
- puts "#{r[:name].rjust(name_width)} #{r[:verb].ljust(verb_width)} #{r[:path].ljust(path_width)} #{r[:reqs]}"
+ puts "#{r[:name].rjust(name_width)} #{r[:verb].ljust(verb_width)} #{r[:path].ljust(path_width)} #{r[:reqs]} #{r[:dests]}"
end
end

0 comments on commit e54f369

Please sign in to comment.