How to specify a route member inside a block in Rails?

Posted by yuval on Stack Overflow See other posts from Stack Overflow or by yuval
Published on 2010-03-03T00:49:42Z Indexed on 2010/04/02 21:13 UTC
Read the original article Hit count: 326

Filed under:
|
|

The following code:

map.resources :users, :has_many => :items

Could be written like this in a block:

map.resources :users do |user|
   user.resources :items
end

How could I write the following code in a block?

map.resources :users, :member => { :start => :post }

Also, where could I find documentation on writing routes in blocks? The Routes Documentation does not seem to show it.

Thank you!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routing