Re: Routes: How would default routes be defined manually?

Ahmy Yulrizka
Mon, 20 Dec 2010 10:24:48 -0000

This is interesting,

it doesn''t work because if you call
member,

the resource mapper call member_scope, which in turn yield

# File ''actionpack/lib/action_dispatch/routing/mapper.rb'',
line 503
def member_scope
  "#{path}/:id"end


but the new is very special method, it call new_scope which in turn yield

# File ''actionpack/lib/action_dispatch/routing/mapper.rb'',
line 507
def new_scope(new_path)
  "#{path}/#{new_path}"end

http://rubydoc.info/docs/rails/3.0.0/ActionDispatch/Routing/Mapper/Resources#shallow-instance_method

Ahmy Yulrizka


On Mon, Dec 20, 2010 at 4:44 PM, Mahmoud Said
<eng.mahmoud.said-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:

> it won''t work, it will be
>
> add_new_priority GET    /priorities/new/add(.:format)
{:action=>"add",
> :controller=>"priorities"}
>
>
> however, the collection plural  form seems more logical to me, you are
> adding a priority to priorities. so you are actually acting on priorities