Are Rails 3 subdomains painless?

I have an application with two sections "Buyers and Sellers". The main "/" section is for buyers, but I have a separate sellers portal, which I now place in / sellers. It might be nicer to move sellers to their own subdomain, for example, "sellers.mydomain.com".

Subdomains do not seem to be very popular, and I read things like testing difficulties, etc. Interestingly, you all have to say about the problem.

+5
source share
1 answer

There are a few things that do pain testing with subdomains, but introducing subdomains as a real supported function in rails 3 has somewhat mitigated these problems.

EDIT : Adding something like your test helper can make testing a lot easier and more understandable.

  def set_subdomain(sub)
    @request.host = sub.present?? "#{sub}.test.host" : "test.host"
  end

EDITx2

http://www.railscasts.com/episodes/221-subdomains-in-rails-3

+2
source

All Articles