On 26 August 2010 16:06, WSzP <[email protected]> wrote:
> Hello,
> In Rails 2 the following works:
>  map.resources :domains, :as => 'domainek', :path_names => { :new =>
> 'uj', :edit => 'szerkesztes' }
> In Rails 3 what is the good way to do this?
> Basically when I write domainek/uj I want to use the domains
> controller with new, etc.
>
> Well, the straight way of doing it would be:
>
> match 'domainek/uj' => 'domains#new', :as => :static
> match 'domainek/szerkesztes' => 'domains#edit', :as => :static
> match 'domainek' => 'domains', :as => :static
>
> But then new_domain_path does not work in the views, plus the above is
> not very rails like.
>
> Can you please tell me what's the good way of doing it in Rails 3.
> Thank you.

The resources method in Rails 3 should still accept the :path_names
option. The :as option has been renamed to :path. So this ought to
work:

resources :domains, :path => 'domainek', :path_names => { :new =>
'uj', :edit => 'szerkesztes' }

Chris

-- 
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