Forum: Ruby on Rails wishlist: revisiting subdomain access in routes.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Pete F. (Guest)
on 2006-03-19 13:17
(Received via mailing list)
Several folks on the list have, over time, expressed interest in being
to access the subdomain info inside routes.rb. This was discussed in
detail late last year by several folks:

In summary, routes can't access the domain, so your best bet is to stick
before_filter in your application.rb.

This strikes me as an ugly hack. Everything else in Rails is so damn
is there a practical reason why we force developers to jump through
hoops to
do subdomain parsing and manipulation? In addition, this could be
an example of a place where convention could prevent every coder that
approaches this issue from creating their own semi-unique solution.
away from this particular sort of creativity is one of the primary
reasons I
love Rails.

It might be way, way too late to get anything together in time for 1.1,
I want to reopen this for discussion with an eye to the future. However,
Rails-core folks are clearly superheros, so on the off-chance this is a
"simple" addition.. here it is.

This topic is locked and can not be replied to.