Microsoft
Software
Hardware
Network
Question : Rails: How do I get the domain name
Is there an easy way to get the domain name of where something was called from?
For example, if I have the same app that is linked to both
www.somesite.com
and
www.somesite.net
, is there an easy way to find out which one the user is clicking through to use the app?
Thanks,
Grant
Answer : Rails: How do I get the domain name
ActionController.host()
http://api.rubyonrails.com
/classes/A
ctionContr
oller/
Abst
ractReques
t.html#M00
0413
1: 2: 3: 4: 5:
Controller @host = request.host View <%= @host %>
Open in New Window
Select All
Random Solutions
Group Policy Not Being Applied
SearchAllTables - doesn't search text fields
Ho do I Convert an eight digit number/general formatting to date?
Resize Ghost Image
Remote Agent Not Installed Error
LDAP Query with multiple domains
Microsoft Access Open Email Message (Outlook) and populate it with data from the database!
Cache Hit Ratio Sysperfinfo
SQL Server 2005/SharePoint Logs getting too big
Restrict outgoing email for certain users