Re: changing the path for map.resources

steve bell
2009-09-16T16:16:31Z

many thanks guys, I ended up using the , :as => and it did the trick.

thanks for the link felix - it''s now in my bookmarks!

Steve

On Sep 16, 2:05 pm, Felix Schäfer
<schae...-SjIeUF6ADzXby3iVrkZq2A@public.gmane.org>
wrote:
> Am 16.09.2009 um 15:03 schrieb David A. Black:
>
>
>
>
>
> > On Wed, 16 Sep 2009, steve bell wrote:
>
> >> Hi there, just starting to get my head around routes but have a
> >> problem that I can''t google my way out of. I have a
restful resource
> >> that''s mapped as:
>
> >> map.resources :terms
>
> >> which gives me  localhost/terms, however I want it to be
localhost/
> >> buzzwords instead.
>
> >> I tried using path_prefix but this just added the prefix before /
> >> terms. I guess I really want a path_replace kind of thing...
>
> >> Refactoring the code would be a real pain. Is there any way to do

> >> this
> >> in the routes.rb file?
>
> > You need to invert the logic:
>
> >   map.resources :buzzwords, :controller => "terms"
>
> Or the other way round:
>
> map.resources :terms, :as => ''buzzwords''
>
> See the other options for resources
herehttp://apidock.com/rails/ActionController/Resources/resources
>
> Regards,
>
> Felix