module
Ruby on Rails latest stable (v7.1.3.2)
-
2 notes
- 1.0.0
- 1.1.6
- 1.2.6 (0)
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (34)
- 2.3.8 (0)
- 3.0.0 (-38)
- 3.0.9 (0)
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
Register or
log in
to add new notes.
elizabrock -
January 6, 2011 - (>= v3.0.0)
2 thanks
Accessing URL helpers in Rails 3
I’ve been upgradings an app to Rails 3 and it took me a bit to find this-
If you were using
include ActionController::UrlWriter
to get the url helpers in rails 2, you should switch to
include Rails.application.routes.url_helpers
for Rails 3
From: http://snipplr.com/view/37063/to-access-url-helpers-urlfor-etc-from-rails-console-rails-3/
stevo -
March 2, 2011
0 thanks
How to deal with Missing host to link to!
You just need to define default_url_options[:host] in your class. The easiest way to do it:
class SomeClass include ActionController::UrlWriter default_url_options[:host] = YourApp::Application.config.action_mailer.default_url_options[:host] def some_method some_superb_url(maybe_even_some_variable_here) end end