# \*name in Rails routes?

**URL:** <https://www.ruby-forum.com/t/name-in-rails-routes/119290>\
**Category:** Rails\
**Created:** [November 5, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/name-in-rails-routes/119290 "2007-11-05T20:35:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [November 5, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/name-in-rails-routes/119290/1 "2007-11-05T20:35:39Z")

</div>

I’ve created a route with a trailing \*name component like this

map.connect ‘foo/bar/\*path’

which will hopefully map routes of the form

foo/bar/u/f/a to

:controller =\> foo  
:action -\> bar  
:path =\> [“u”, “f”, “a”]

However, I’m not quite sure how to write the corresponding url\_for to  
generate this sort of url. For example

url\_for :controller =\> “foo”, :action =\> “bar”, :path =\> [“u”, “f”, “a”]

doesn’t do what I want. Nor does

url\_for {:controller =\> “foo”, :action =\> “bar”}, [“u”, “f”, “a”]

How does one write the correct url\_for to generate the type of URL I’m  
looking for? Sorry for the noob question, but I’m pretty new to  
Rails…

– bb

---

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [November 6, 2007, 2:56pm UTC](https://www.ruby-forum.com/t/name-in-rails-routes/119290/2 "2007-11-06T14:56:06Z")

</div>

Just a guess, but try :path =\> [“u”,“f”,“a”].join(“/”)

On Nov 5, 12:35 pm, Aaron C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
