Url reformatting


I am new to ruby on rails and i have urls which are in the form of

i want to reformat the above url to user friendly way like

Is there any way how to do it.


Looks like named routes to me (code in routes.rb):

map.demo “/demo/home/:demo”, :controller => “demo”, :action => “home”

You can then just use “demo_path(:demo => 10)” in your controllers/views to get the url you want.

Though I think you’d be better off rethinking your whole app structure into something more RESTful. Getting a book on Rails (e.g. The Rails Way) could be a good idea.

Best regards

Peter De Berdt

Peter De Berdt wrote: