Can anyone please explain to me how to get ugly urls like :
to be something nice like:
or something like that?
I’ve read a bit about routes but I don’t see any examples anywhere
really of how to do this.
Can anyone please explain to me how to get ugly urls like :
to be something nice like:
or something like that?
I’ve read a bit about routes but I don’t see any examples anywhere
really of how to do this.
On Jun 5, 2008, at 2:42 PM, Amanda … wrote:
I’ve read a bit about routes but I don’t see any examples anywhere
really of how to do this.
map.connect ‘browse/:cal_name/:day/:month/:year’, :controller =>
‘browse’, :action => ‘day’
Assuming that the default route was picking up your example URL.
-Rob
map.connect ‘browse/:cal_name/:day/:month/:year’, :controller =>
‘browse’, :action => ‘day’Assuming that the default route was picking up your example URL.
-Rob
where do I do that?
and also, since the :day, :cal_name etc are parameters would I have to
do ‘browse/params[:cal_name]/params[:day]/…’?
On Jun 5, 2008, at 3:00 PM, Amanda … wrote:
where do I do that?
In your project’s config/routes.rb file, of course.
oh lol thanks so much!
Amanda,
You may want to read into how you can setup customer routes using the
routes.rb files in rails… Furthermore you may want to read into
RESTful development, and how rails deals with Resources etc… might
help with your issue here.
There’s a TON of information on this on the net, and there’s just too
much to go through here…
Or, I find The Rails Way by Obie F. exceptionally clear on this
topic. Excellent book in many ways, but it seems to really shine on
routings.
Ron
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs