0

Is there a way to point top-level domains to individual records in a rails app - similar to subdomains. kinda like http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

Kara
  • 6,115
  • 16
  • 50
  • 57
King Pangilinan
  • 597
  • 1
  • 14
  • 26

1 Answers1

0

You want to look at constraints and the request object:

http://edgeguides.rubyonrails.org/action_controller_overview.html#the-request-object

match '/' => {:controller => "mycontroller", :action => "show", :id => "1"}, 
  :constraints => { :domain => "mydomain.com" }

(Remove the line-break if this doesn't work)

Tigraine
  • 23,358
  • 11
  • 65
  • 110