On 6/8/07, Dan Kubb <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I was thinking that a syntax like the following might work though:
>
> # routes.rb
> map.namespace :admin do |a|
> a.resources :workshops do |w|
> w.resources :sessions
> end
> end
>
> # views
> <%= url_for([:admin, @workshop, @session]) %>
> <%= link_to('Session', [:admin, @workshop, @session]) %>
> <% form_for([:admin, @workshop, @session] do |f| %>
> # ...
> <% end %>
While I'm not a huge fan of the explicit array, it does fit with the current
approach for handling nested resources. I got a version working last night
which took a :name_prefix in the options, this should be easily adjusted to
handle this case.
In the example above would it really be :admin, or would it need to be
'admin_' matching the appropriate namespace? More specifically, do you
assume the '_', or do you just use the literal string which would account
for multiple nested namespaces?
Josh
--
Josh Knowles
[EMAIL PROTECTED]
http://joshknowles.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---