• Happy Coding

Getting the domain name for a request with Ruby on Rails

Just tried to get the domain name in an ActionController and here we go: e.g.

render :text => request.domain()
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Ma.gnolia
  • MisterWong
  • Reddit
  • SphereIt
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yigg
  • LinkedIn
  • Print this article!
  • Tumblr
  • Pownce
Share your opinion! Post your thoughts.