diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-11-29 15:23:27 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-11-29 15:23:27 -0600 |
commit | 3f025e64083c4a0cde4841254a88ef54780824f9 (patch) | |
tree | 4946ad0ee21310efda05cc3c638ab2da667e4b51 /actionpack | |
parent | 327545c3ae904d1a9c67de3e280c182ed6418023 (diff) | |
download | rails-3f025e64083c4a0cde4841254a88ef54780824f9.tar.gz rails-3f025e64083c4a0cde4841254a88ef54780824f9.tar.bz2 rails-3f025e64083c4a0cde4841254a88ef54780824f9.zip |
Resource collection should be defined before member routes
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index cfe7425a61..087d4ab478 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -75,18 +75,18 @@ module ActionDispatch with_scope_level(:resources, :name => singular) do yield if block_given? + collection do + get "", :to => :index, :as => plural + post "", :to => :create + get "new", :to => :new, :as => "new_#{singular}" + end + member do get "", :to => :show, :as => singular put "", :to => :update delete "", :to => :destroy get "edit", :to => :edit, :as => "edit_#{singular}" end - - collection do - get "", :to => :index, :as => plural - post "", :to => :create - get "new", :to => :new, :as => "new_#{singular}" - end end end end |