Forum: Ruby on Rails wishlist: revisiting subdomain access 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.
496ed7f402fc56b1f997855941272ad4?d=identicon&s=25 Pete Forde (Guest)
on 2006-03-19 12:17
(Received via mailing list)
Several folks on the list have, over time, expressed interest in being
able
to access the subdomain info inside routes.rb. This was discussed in
great
detail late last year by several folks:

http://wrath.rubyonrails.org/pipermail/rails/2006-...

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

This strikes me as an ugly hack. Everything else in Rails is so damn
slick;
is there a practical reason why we force developers to jump through
hoops to
do subdomain parsing and manipulation? In addition, this could be
considered
an example of a place where convention could prevent every coder that
approaches this issue from creating their own semi-unique solution.
Getting
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,
but
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.

Respectfully,
Pete
This topic is locked and can not be replied to.