I have tried all night trying to find a way to get the host name which is
currently being used within my routes.rb file to do some case/when switching
for specific domains such as this

        cgi = ActionController::CgiRequest.new(CGI.new)
        case cgi.domain(1)
                when /www/
                        map.connect '', :controller => 'public', :action =>
'index'
                when /internal/
                        map.connect '', :controller => 'admin', :action =>
'index'
        end

And have had no success. The domain(1) is empty in this case.

I have tried a similar approach in one of my views, using the
@request.domain(1) and that works PERFECT. Yet I have found no way to access
the same @request.domain(1) within my routes.rb as the @request object has
not been loaded yet.

One thought was to use the ENV['HTTP_HOST'] variable. But this appears to be
empty with my lighttpd/apache2 setup.

- Nathaniel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Nathaniel S. H. Brown                           http://nshb.net 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to