Pete Forde
2006-Mar-19 08:34 UTC
[Rails] wishlist: revisiting subdomain access in routes.rb
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 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