User-friendly nested routes in rails?

I'm not sure, but try this: scope :path => '/:group_name' do resources :users end You must find your group by params:group_name if you use this approach.

Yes, it is very easy to do in both Rails 2 and 3. Assuming you're using Rails 3, you would do it like this match ":group/user/:id", :to => "group#user" When you use the match method, URL parts with a preceding colon will become parameters, so in your controller you would have params:group and params:id available. The :to paramater defines the controller and the action, so in this example it would send the request to the GroupController and the user action.

:to can actually point to any Rack application end point, the "cont#action" is just a shorthand. If you are using resources, you can set those up as normal, and then just define this non-standard route somewhere else in the stack and both will work side-by-side.

Thanks! Guess I should have specified but I am using rails 2.3. – the_tokenizer Feb 15 at 19:52 will this work for 2.3? Also, I would like user_path(@user) to generate this path, will it work automatically?

– the_tokenizer Feb 15 at 19:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions