Forum: Ruby on Rails [Frank] How can I access the domain name in routes.rb?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
softwareengineer 99 (Guest)
on 2006-01-28 09:36
(Received via mailing list)
I am trying to setup an application where the URLs must be of the format

  1) sub.domain.com/sub/category
  and
  2) sub.domain.com/search/something

  In the first path the first part of the subdomain must match the
folder name.

  I tried to use request.domain(2) to get the domain information but
keep getting errors.

  I was thinking that may be I can setup regexp to math the subdomain
name with the folder but to no avail.

  My questions are:
  How can I setup the proper routes for these URLs?
  How can I access the domain name in routes.rb?


  Thanks

  Frank
This topic is locked and can not be replied to.