The shift to the :has_many and :has_one options when defining nested
resource routes has me perplexed. The block format allows me to define
custom REST actions like publish in the example below:
map.resources :users do |user|
user.resources :articles, :member => { :publish => :put }
end
It also allows for multiple levels of nesting if necessary.
What I'd really like to know is how do I enable custom REST actions
for nested resources using the newer options technique?
Thanks Ryan, that's what I figured. That being the case, is the newer
options definition slated to be a replacement for the block definition
or will there continue to be coexistence?
map.resources :users, :has_many => [:fingers], :has_one => [:nose]
map.resources :users do |users|
users.resources :peepers, :controller => 'eyes' # So we can call
eyes 'peepers' in the site URLs
end
I have to use the old block format to specify a different controller
name.