# Homepage\_url?

**URL:** <https://www.ruby-forum.com/t/homepage-url/96837>\
**Category:** Rails\
**Created:** [July 2, 2006, 11:34am UTC](https://www.ruby-forum.com/t/homepage-url/96837 "2006-07-02T11:34:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [July 2, 2006, 11:34am UTC](https://www.ruby-forum.com/t/homepage-url/96837/1 "2006-07-02T11:34:10Z")

</div>

does the routes.rb have some kind of automatic generated url\_for a ‘’  
map.connect?  
(say, something like url\_for\_homepage or homepage\_url) …i’ve looked  
around, tried a couple of combos but nothing really worked. do i have  
the wrong lead?

?

thanks…

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [July 2, 2006, 11:56am UTC](https://www.ruby-forum.com/t/homepage-url/96837/2 "2006-07-02T11:56:00Z")

</div>

On 7/2/06, jeff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> does the routes.rb have some kind of automatic generated url\_for a ‘’  
> map.connect?  
> (say, something like url\_for\_homepage or homepage\_url) …i’ve looked  
> around, tried a couple of combos but nothing really worked. do i have  
> the wrong lead?
> 
> ?
> 
> thanks…

At the end of your routes map use something like  
map.connect ‘/’, :controller =\> ‘default\_controller’, :action =\>  
‘default\_action’

but be sure to remove the index.html from your public directory. If  
that is  
in there it will be served instead of any action specified in the  
routes.

–

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [July 2, 2006, 12:25pm UTC](https://www.ruby-forum.com/t/homepage-url/96837/3 "2006-07-02T12:25:52Z")

</div>

…i was actually hoping to see if there was some kind of automatic  
method (for all of my views?) that is generated when i do the action  
you’ve specified (ie, map.connect ‘’ , :controller =\>…)  
i happen to know there is a actionname\_url method or something similar  
that is generated when you map.connect some actionname, and i was  
wondering if there was a convention for a ‘’ map.connect…if not, then  
not, although i am pretty sure i saw some posting on  
[wiki.rubyonrails.com](http://wiki.rubyonrails.com), but then again, after looking through it a second  
time today, and not finding it, i’m not really sure anymore.

?

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [July 2, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/homepage-url/96837/4 "2006-07-02T16:07:48Z")

</div>

jeff wrote:

> ?

Used named routes and you can explicitly set what you want it to be  
called.

IE:

map.homepage …

instead of:

map.connect …

Then homepage\_url will work.

hth
