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
I am Bojan Mihelac and this blog is dedicated to share code, thoughts, tools and advices I came up with while working in
Speak your mind: