mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
the (public) routing DSL does not accept symbols for get|post|put|delete|match
This commit is contained in:
@@ -313,7 +313,7 @@ To add a member route, just add a +member+ block into the resource block:
|
||||
<ruby>
|
||||
resources :photos do
|
||||
member do
|
||||
get :preview
|
||||
get 'preview'
|
||||
end
|
||||
end
|
||||
</ruby>
|
||||
@@ -324,7 +324,7 @@ Within the block of member routes, each route name specifies the HTTP verb that
|
||||
|
||||
<ruby>
|
||||
resources :photos do
|
||||
get :preview, :on => :member
|
||||
get 'preview', :on => :member
|
||||
end
|
||||
</ruby>
|
||||
|
||||
@@ -335,7 +335,7 @@ To add a route to the collection:
|
||||
<ruby>
|
||||
resources :photos do
|
||||
collection do
|
||||
get :search
|
||||
get 'search'
|
||||
end
|
||||
end
|
||||
</ruby>
|
||||
@@ -346,7 +346,7 @@ Just as with member routes, you can pass +:on+ to a route:
|
||||
|
||||
<ruby>
|
||||
resources :photos do
|
||||
get :search, :on => :collection
|
||||
get 'search', :on => :collection
|
||||
end
|
||||
</ruby>
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
# Sample resource route with options:
|
||||
# resources :products do
|
||||
# member do
|
||||
# get :short
|
||||
# post :toggle
|
||||
# get 'short'
|
||||
# post 'toggle'
|
||||
# end
|
||||
#
|
||||
# collection do
|
||||
# get :sold
|
||||
# get 'sold'
|
||||
# end
|
||||
# end
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
# resources :products do
|
||||
# resources :comments
|
||||
# resources :sales do
|
||||
# get :recent, :on => :collection
|
||||
# get 'recent', :on => :collection
|
||||
# end
|
||||
# end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user