2006-02-23

Rails and URLs without a host name/port number

I was digging a in how cache_page works and found a nice little surprise.

Sometimes you want URLs in your site to follow some convention. Like not having host name or port number. You can specify options in each invokation of url_for. Or you can be smart.

Override a method default_url_options in your controller and from within return a hash with your favourite options. Works for whole application if you do it in ApplicationController

0 comments: