I'm trying to build a url from inside a controller/action. I want
this url to contain the hostname ("http://myhost.edu/...")
I'd like the hostname to by dynamic, but if I use:
url_for :controller => "mycontroller", :action => "myaction"
I get the error:
Missing host to link to! Please provide :host parameter or set
default_url_options[:host]
I've also tried to get at, e.g., request.env[], but that too
is unknown in the controller (not sure why).
Is there a "right" way to build a url that includes the current
hostname, whatever it is? I was also hoping not to have to
wire something into environment.rb, but maybe that's "correct".
At this point, I'm just trying to generalize user_notifier.rb
in RestfulAuthentication so that I don't have to hardwire the
hostname in the activation url that's sent out. This controller
inherits from ActionMailer::Base (hmmm... is that the problem?).
Thanks.
-glenn
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby