i think this king of manipulation is more clear
and you dont need to declare one per resource route it works like this too
resources :mailing_addresses, :controller => 'addresses',
:requirements => { :context_type => 'addresses'}
then in the controller check for context_type like this
if params[:context_type] == "addresses"
you see is almost then same but less code
the result is similar but part of the work is done by the router, and
instead of checking the request object you check this
On Sun, Sep 12, 2010 at 3:38 PM, Robert Pankowecki (rupert) <
[email protected]> wrote:
> I think I started to understand your idea. You want me to write my own
> custom routes for every action but in the place of URL where usually
> controller name is place put my own custom requirement ?
>
> like
>
> get "user/:user_id/:addres_type/"
> get "user/:user_id/:addres_type/new"
> get "user/:user_id/:addres_type/:id"
> get "user/:user_id/:addres_type/:id/edit"
>
> ?
>
> Robert Pankowecki
>
> --
> 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.
>
>
--
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.