I have a website that has 3 main sections: 1. Tickets 2. Company (About Us) 3. Admin I would prefer to use subdomains for these sections: tickets.whatever.com, company.whatever.com The problem though is that I need a specific set of controllers for each section. I dont want to do tickets.whatever.com/tickets/some_controller. It kind of defeats the purpose of a subdomain. Any ideas? Thanks for your help. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 7, 2:52 am, Ben Johnson <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have a website that has 3 main sections: > > 1. Tickets > 2. Company (About Us) > 3. Admin > > I would prefer to use subdomains for these sections: > tickets.whatever.com, company.whatever.comThis should be done with routes. You have to rewrite routes and url_for a bit. And don''t forget to set ActionController::Base.session_options[:session_domain] to ".whatever.com" I don''t think in your case you''ll benefit much from using subdomains, but it''s only up to to decide whether to spend decent amount of time hacking ActionController::Routing to and ActionView::Helpers::UrlHelper to map things back and forth, or rest happy with default routing.> > The problem though is that I need a specific set of controllers for each > section. I dont want to do tickets.whatever.com/tickets/some_controller.Does it means ''tickets'' is module in your setup, like in Tickets::SomeTicketsController#action_on_ticket? You don''t need it anyway, TicketsController filled with tickets related actions is enough.> It kind of defeats the purpose of a subdomain. > > Any ideas? > > Thanks for your help. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 07 Jun 2007, at 01:52, Ben Johnson wrote:> I have a website that has 3 main sections: > > 1. Tickets > 2. Company (About Us) > 3. Admin > > I would prefer to use subdomains for these sections: > tickets.whatever.com, company.whatever.com > > The problem though is that I need a specific set of controllers for > each > section. I dont want to do tickets.whatever.com/tickets/ > some_controller. > It kind of defeats the purpose of a subdomain.You should use the request_routing plugin from Dan Webb. http://agilewebdevelopment.com/plugins/request_routing Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> You should use the request_routing plugin from Dan Webb. > > http://agilewebdevelopment.com/plugins/request_routing>> I dont want to do tickets.whatever.com/tickets/some_controllerThis requirement makes request_routing inappropriate. Ben asking for mapping subdomain to controller name, while request_routing provides a way to include subdomain in mapping requirements. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Actually, using the request_routing plugin is a good idea, as it allows you to map to different controllers based on subdomain. I use it for exactly that purpose myself. -- Benjamin Curtis http://www.bencurtis.com/ -- blog http://agilewebdevelopment.com/rails-ecommerce -- build e-commerce sites with Rails On Jun 7, 2007, at 7:19 AM, liquidautumn wrote:> >> You should use the request_routing plugin from Dan Webb. >> >> http://agilewebdevelopment.com/plugins/request_routing > >>> I dont want to do tickets.whatever.com/tickets/some_controller > This requirement makes request_routing inappropriate. > Ben asking for mapping subdomain to controller name, while > request_routing provides a way to include subdomain in mapping > requirements. >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---