Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:03:29+00:00 2026-06-14T02:03:29+00:00

My rails app is a way for users to create their own basic website.

  • 0

My rails app is a way for users to create their own basic website. So each of them will have a root folder that is example.com/user/1. They will have other pages like example.com/user/1/about etc. How do I configure Rails and Heroku so that something like www.user1.example points to example.com/user/1, and something like www.user1.example/about directs to example.com/user/1/about?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:03:30+00:00Added an answer on June 14, 2026 at 2:03 am

    The way I did in my app was first have the list of user domains in the database. Then create an advanced constraint
    http://edgeguides.rubyonrails.org/routing.html#advanced-constraints

    In this case, my constraint class looks like this:

    class UserDomainConstraint
      def self.matches?(request)
        UserDomain.all.map(&:domain_name).include? request.domain
      end
    end
    

    And then use that constraint in the route

    root to: 'user_domains#index', :constraints: UserDomainConstraint
    

    My action then takes a look at request.domain and acts accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails app which requires users to verify that they own a
In my Rails app I have Users. Users are asked for their home city
I have a rails app I am working on that allows users to create
So I have a rails app That lets users create lists and put items
In my Rails app, I have the following objects: Group: has_many users through group_membership
I have a Rails 3 App using devise. I want to create a User/Profile
I have a standard many-to-many relationship between users and roles in my Rails app:
I have built a ruby on rails app that allows for users to track
Currently I have a Rails 3 app that subscribes new users up to MailChimp.
I have a rails app where users share specific kinds of photos. Currently the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.