Frustrations with routing

Lets say I’ve got this mapped out

map.resources :owners do |owners|
owners.resources :possessions

This gives me routes looking like this:

…/owners/:id/
…/owners/:owner_id/possessions/:id/

I’m very frustrated that the routes do not look like this:

…/owners/:owner_id/
…/owners/:owner_id/possessions/:possession_id/

This causes problems when I want to share code between these
controllers that uses either.

params[:id] <-- meaning the id of the owner
params[:owner_id]

Lord this gets my goat and jives my Johnson the wrong way.

Have you taken a look at makes_resourceful? Even if you don’t use the
plugin itself, you can nick its code for things like the
current_object method.

–Jeremy

On 8/17/07, Collin M. [email protected] wrote:

Lord this gets my goat and jives my Johnson the wrong way.


http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/

Holy wow! I like the look of makes_resourceful.

Thanks.

On Aug 17, 4:26 pm, “Jeremy McAnally” [email protected]d

Yeah, it is.

And it is wonderful.

Holy wow! I like the look of makes_resourceful.

Isn’t it make_resourceful ?

Wybo

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