Informatika Mihelac
April 28 2007 rails

Create URL's outside of controllers and views

If you have a need to create URL’s outside of controllers and views include UrlWriter helper and set default_url_options.

include ActionController::UrlWriter
default_url_options = "www.example.com"

This way, you can create URL’s and use named routes from mailers, migrations, import scripts, etc. More info on Rails Framework Documentation

Speak your mind:

(Required)

(Required)


(You may use textile in your comments.)

About

I am Bojan Mihelac and this blog is dedicated to share code, thoughts, tools and advices I came up with while working in Informatika Mihelac.

Contact: bmihelac@mihelac.org

RSS feedSubscribe to RSS Feed