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
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
On 29 Jan 2008, at 06:30, Chris O. 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
I don’t think my question was very clear. I am confused how to include
the subdomain in the routing method call.
ex
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs