I am looking for a way to use RESTful routes, but include the ability to add the required subdomain to the url. I have found a couple plugins, but they don''t allow for the RESTful routes. Does anyone know of any? Thanks -- 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 29 Jan 2008, at 06:30, Chris Olsen wrote:> I am looking for a way to use RESTful routes, but include the > ability to > add the required subdomain to the url. > > I have found a couple plugins, but they don''t allow for the RESTful > routes. > > Does anyone know of any?Why wouldn''t account_location allow you to use RESTful routes? You just check the subdomain in a before_filter (if you''re using it as a way of determining the customer account) and the rest is exactly the same as working on a normal website without subdomain authentication. 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 -~----------~----~----~----~------~----~------~--~---
I don''t think my question was very clear. I am confused how to include the subdomain in the routing method call. ex # redirect the user to the account cpanel for their subdomain redirect_to account_url #this url will not include the proper subdomain. After checking out the account_location lib file it can be seen that the equivalent can be done with: redirect_to :host => account_host(@account.subdomain), :controller => "account" The downfall is that I am unable to use the routing methods. But, as you mentioned, when accessing the subdomain within a controller it is easy to do so by having a before_filter that extracts it from the request.subdomains array. -- 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 -~----------~----~----~----~------~----~------~--~---