On 07 Nov 2008, at 02:39, Tim Uckun wrote: >> account_location plugin, then use account_domain and use it as a >> key in your >> access management. >> Different templates, same functionality: either switch the >> stylesheet (CSS) >> or go un-DRY by using different view folders for each domain. >> > > The account_location plugin talks about subdomains. Do you know if > it's suitable for different top level domains?
All it does is put some convenience methods around the built-in request.domain, request.subdomains and request.port_string methods. Sometimes it's better to go and have a look at the actual code of the plugin to see what it does (and the code of account_domain is so simple even someone who never wrote a line of ruby would understand). account_domain will return the domain and port without the subdomain part, examples: • www.rubyonrails.org => rubyonrails.org • www.rubyonrails.org:5000 => rubyonrails.org:5000 • api.rubyonrails.org => rubyonrails.org • some.demo.app.rubyonrails.org => demo.app.rubyonrails.org If you want just the domain and nothing else (port number, …), just request.domain is what you want. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

