I am trying to access a url helper that I'm using in my event
controller like this event_url(event)
.
Is there a way to access this in my event
model?
Something like this?
event_url(self)
Im using rails v2.3.11.
I am trying to access a url helper that I'm using in my event
controller like this event_url(event)
.
Is there a way to access this in my event
model?
Something like this?
event_url(self)
Im using rails v2.3.11.
Try adding this in your model
include ActionController::UrlWriter
You also need to add config lines to env configs: development.rb
config.action_controller.default_url_options = {:host => "localhost:3000"}
production.rb
config.action_controller.default_url_options = {:host => "example.com"}