ruby - Rails/Heroku Subdomain -
i'm trying setup masking 1 of rails app subdomains.
hypothetically, main app website called www.cats.com
i've got subdomain on main application called www.care.cats.com
i've got domain managed godaddy called www.catscare.com
currently, have setup such going www.catscare.com goes www.care.cats.com should. however, whenever try add slug @ end of link example (www.catscare.com/blah), rails application gives me 404, whereas if go www.care.cats.com/blah, gives me correct page. think has subdomain constraints in routes.rb file.
scope "/:slug", module: :claims_portal, as: :claims_portal, constraints: claimsportalconstraint.new my actual constraints file here:
class claimsportalconstraint def matches?(request) in_claims_subdomain?(request) && merchant_exists?(request) end private def in_claims_subdomain?(request) request.subdomain =~ /^(claims|claims-sandbox|claims-staging|claims-regression|care|care-sandbox|care-staging|care-regression)$/ end def merchant_exists?(request) company.find_by(slug: request.params[:slug]).present? end end
Comments
Post a Comment