Is this what you are looking for? http://guides.rubyonrails.org/routing.html#request-based-constraints
On Thu, Aug 18, 2011 at 3:28 PM, Tim Uckun <[email protected]> wrote: > I am wondering if there is a way to map subdomains to controllers in > rails3. I have been digging around the net and I can't find anything > that indicates this is possible. > > Basically I want to do something like this > > > constraints(app = App.new) do > #if there is a sub domain use the events controller > root :to => app.controller. + "#index" > end > > or the equivalent of this > > controller request.subdomain do > ... > end > > Of course routes does not have the request object but you get the > idea. I want to route individual subdomains to different controllers. > > Has anybody done this. I have gotten tantalizingly close with > Constraints but still not there yet. > > -- > You received this message because you are subscribed to the Google Groups > "WellRailed" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/wellrailed?hl=en. > > -- Shane Mingins -- You received this message because you are subscribed to the Google Groups "WellRailed" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/wellrailed?hl=en.
