Edge Rails: Nested resources and the new url_for


#1

Hey,

recently simply_helpful has been integrated into edge rails, and
url_for now supports array for nested resources.

So I can specify this:
remote_form_for([@effort.user,@effort]) for a route like /users/x/
efforts

however, this looks for “efforts_url”

there was a patch that also automatically generates name_prefixes for
nested
resources, with the form user_efforts_… which is very handy.

now, if I want to use both advantages, I would have to specify two
paths:

map.resources :users do |users|
users.resources :efforts, :collection => { :subpage
=> :get }, :name_prefix => nil
users.resources :efforts, :collection => { :subpage => :get }
end

is there a way to solve this? eg. let url_for use the name prefix too?

thanks,
christoph


#2

On 7/25/07, sol removed_email_address@domain.invalid wrote:

is there a way to solve this? eg. let url_for use the name prefix too?

Prepend the symbol of the namespace as the first arg of the array:
url_for [:my_namespace, @parent_object, @child_object]


Josh K.
removed_email_address@domain.invalid
http://joshknowles.com