that's interesting, apparently there is  3rd type other than collection and
member that is specific to the new.


if u checked at actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:953

you can how the default routes are added:

            collection do
              get  :index if parent_resource.actions.include?(:index)
              post :create if parent_resource.actions.include?(:create)
            end

            new do
              get :new
            end if parent_resource.actions.include?(:new)

            member do
              get    :edit if parent_resource.actions.include?(:edit)
              get    :show if parent_resource.actions.include?(:show)
              put    :update if parent_resource.actions.include?(:update)
              delete :destroy if parent_resource.actions.include?(:destroy)
            end

I'm not sure if you can use the "new" on your own. try it and let me know
how it goes :)


On Mon, Dec 20, 2010 at 11:02 AM, bourne <[email protected]> wrote:

>
>
> On Monday, December 20, 2010 9:44:36 AM UTC+1, modsaid wrote
>
>> I think what confuses you is: "why is it   add_priorities_path  and not
>> add_priority_path like the new_priority_path" (in a singular form)?
>>
>> is that right ?
>>
>
> Correct :)
> (I know that this behaviour is fine for collections but I want to
> understand why new is different and how to declare it to be identical)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
Mahmoud Said
Software Engineer - eSpace
blog.modsaid.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to