# Wishlist: revisiting subdomain access in routes.rb

**URL:** <https://www.ruby-forum.com/t/wishlist-revisiting-subdomain-access-in-routes-rb/83854>\
**Category:** Rails\
**Created:** [March 19, 2006, 12:17pm UTC](https://www.ruby-forum.com/t/wishlist-revisiting-subdomain-access-in-routes-rb/83854 "2006-03-19T12:17:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pete\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@Pete\_F](https://www.ruby-forum.com/u/Pete_F)\
**Post date:** [March 19, 2006, 12:17pm UTC](https://www.ruby-forum.com/t/wishlist-revisiting-subdomain-access-in-routes-rb/83854/1 "2006-03-19T12:17:09Z")

</div>

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-January/008114.html](http://wrath.rubyonrails.org/pipermail/rails/2006-January/008114.html)

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
