# Routes,maps, something\_url, some simple questions i am sure

**URL:** <https://www.ruby-forum.com/t/routes-maps-something-url-some-simple-questions-i-am-sure/85691>\
**Category:** Rails\
**Created:** [February 15, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/routes-maps-something-url-some-simple-questions-i-am-sure/85691 "2007-02-15T16:12:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![koloa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/4bbf92/32.png) [@koloa](https://www.ruby-forum.com/u/koloa)\
**Post date:** [February 15, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/routes-maps-something-url-some-simple-questions-i-am-sure/85691/1 "2007-02-15T16:12:19Z")

</div>

hi,  
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(something.id)) %\>

is this the same as calling link\_to like this?

\<%= link\_to (“show me details”, “localhost:3000/nj/” + something.id) %\>

what is the difference between defining map like

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

vs

map.connect “nj/detail” :action =\> detail, :controller =\> ‘nj’

---

<div class="post-metadata">

**Author:** ![koloa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/4bbf92/32.png) [@koloa](https://www.ruby-forum.com/u/koloa)\
**Post date:** [February 15, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/routes-maps-something-url-some-simple-questions-i-am-sure/85691/2 "2007-02-15T16:20:21Z")

</div>

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  
days]  
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  
map.detail.

RSL

---

<div class="post-metadata">

**Author:** ![koloa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/4bbf92/32.png) [@koloa](https://www.ruby-forum.com/u/koloa)\
**Post date:** [February 15, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/routes-maps-something-url-some-simple-questions-i-am-sure/85691/3 "2007-02-15T16:29:18Z")

</div>

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.
