[Rails] clean(er) urls & mod_rewrite

Johan Sörensen johans at gmail.com
Wed Oct 13 07:16:16 GMT 2004


Hi list.

I'm still trying to wrap my head around the Rails way if doing certain
things, so please do tell me if this is the wrong approach all
together. Basicly, I have a "project" with many "assets", "people" and
so on. Now, being tainted with the bad manners that Perl and PHP
teaches you,  I'd like an url space that looks something like this:
/project/<projectid>/people/<userid>/show 

But I'm not sure if rails supports this? seeing as the dispatcher
rewrite would look something like controller+id+controller+id+action.
Or is it "bad" to do this kinda stuff in rails, seeing as we have a
(rather sweet) relational system through belongs_to and so on..

I've been playing around with mod_rewrite and the link_to/url_for
methods but with little luck, specificly, I'm not sure I'm still
getting how the :controller_prefix, :action_prefix and so on should
work together with the rewrite rules..?

Do any of the above even make any sense? :)

-- johan


More information about the Rails mailing list