Mapping parameter in a RESTful route

Hello,

Is it possible to define a RESTful route like “map.resources :projects”
having the id parameter mapped to params[:project_id] instead of
params[:id]?

I searched in
http://api.rubyonrails.org/classes/ActionController/Resources.html but
could
not find an option for this.

Regards,
Florent

Florent F.rent wrote:

Is it possible to define a RESTful route like “map.resources :projects”
having the id parameter mapped to params[:project_id] instead of
params[:id]?
If I understand your questions correctly this screencast from Ryan B.
might help:
http://railscasts.com/episodes/63-model-name-in-url

It may not be exactly what you’re looking for, but it might help you get
there.

Thanks Robert for your answer, even if it was not what I was looking
for.
Anyway meanwhile I found an alternative solution to my problem, and had
no
more to have the id parameter mapped to params[:project_id] instead of
params[:id]?

Florent

2009/7/28 Robert W. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs