On 8 Sep 2008, at 16:25, Joe Peck wrote:
> >> >> That's normal: rake tasks are outside the request cycle, so they've >> no >> way of knowing how people access the site (ie localhost, a dotted ip >> address, one of the many domain names pointing at the server). >> Maybe you could explain what it is you are trying to do? >> >> Fred > I'm trying to send out an email from within the rake task, and I > need to > include a link in the email to a certain page on my site. > > In development, I'd want the page to be > "http://localhost:3000/fruits/my_fruit", > > but in production, I'd want it to be "http://apples.com/fruits/my_fruit > " > > I'd rather not hard-code in the domain names, I'd like some way to > just > grab what domain I'm on and use that. I think you're going to have to have some config file or whatnot. Just looking at my server it hosts half a dozen domains - there's no way it can guess which is the one you're interested in this time. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

