Forum: Ruby on Rails routes,maps, something_url, some simple questions i am sure.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
koloa (Guest)
on 2007-02-15 17:12
i just started learning how to custimize my urls but i have a few
questions that im sort of unsure about.

first. if i do this.

map.detail "nj/:id"

in my view for controller 'nj' i can do something like this?

 <%= link_to ("show me details", detail_url( %>

is this the same as calling link_to like this?

<%= link_to ("show me details", "localhost:3000/nj/" + %>

what is the difference between defining map like

map.detail :action => detail, :controller => nj


map.connect "nj/detail" :action => detail, :controller => 'nj'
Russell N. (Guest)
on 2007-02-15 17:20
(Received via mailing list)
As far as your link_to usage, yes. They're the same. The named route is
easier to maintain codewise but a little slower [at least in the olden
than writing it out by hand like you do in the second example. The
difference between those last map.connect and map.details is 1.
map.detailscreates a named route where
map.connect doesn't and 2. You'll need to add the mapping "nj/:id" to

koloa (Guest)
on 2007-02-15 17:29
thanks rsl, its clear now.

tried to look up something_url in the rails api, but didnt know what
title to look under. wasnt sure if its an extension of url_for.
This topic is locked and can not be replied to.