last post I wrote simple work on customizing rails routes now we will play more. It is easy and fun and more use full
this my main page and url is http://localhost:3000/mailheaders it is not cool URL for main page so how to change it.
open you config/routes.rb file in ROR project and add following to do it
map.connect('madhuka', {:controller => "mailheaders", :action => "index"})
woow.. it done.
so I need to change the url places in working on it
http:/ host/controller/action? params
eg: http://localhost:3000/message/givesentmessage?to=aaa
and lets change it as you wish (I am put params in url in midle)
http:/ host/controller/params/action
add this to routes.rb file
map.connect('messages/:to/giveMessages/', {:controller => "message", :action => "givesentmessage"})
woooww….. it is easy and very useful!!
Add a comment