Permalink
Browse files

Resource collection should be defined before member routes

  • Loading branch information...
1 parent 327545c commit 3f025e64083c4a0cde4841254a88ef54780824f9 @josh josh committed Nov 29, 2009
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -75,18 +75,18 @@ def resources(*resources, &block)
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

0 comments on commit 3f025e6

Please sign in to comment.