Use a url. :host => "localhost:3000" or :host => "mywebsite.com"

Dieter Lunn
http://www.coder2000.ca



On Tue, Mar 9, 2010 at 11:44 PM, Tom Mac <[email protected]> wrote:
> Hi
>   In my application I have a mail sending part in which a user get mail
> with a link to activate his account. What I am currently doing is as a
> part of test I created a staging environment And in
> config/environments/staging.rb I write like
> config.action_mailer.default_url_options = { :host => "Ip_address_here"
> }
>
>     It is working fine And the user get a mail with content say to
> click http://192.168.0.12/activate/token
>
>      Now a problem I find is suppose if have to test the same
> application in another server in another location I have to edit the
> above to match the IP address of that machine  And one more problem is
> if it is hosted in a public IP a user belong to that network get a mail
> like say Click
> http://72.x.x.x/actiavate/token to activate. But it may not work from
> that network. So agin I have to edit and change it
>   My question: Is this the standard way ?.Please advise me the correct
> approach to do this. Or Can I use ActionController::Request class for
> this
>
>
> Thanks in advance
> Tom
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to