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

  • SEARCH
  • Home
  • 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 6132015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:02:56+00:00 2026-05-23T17:02:56+00:00

So I have my table users and each record has a username field and

  • 0

So I have my table users and each record has a username field

and I have my root to controller main and action `index

root :to => 'pages#main'

so if go to http://mydomain.com It’ll show my main#index page and i have the about and contact pages as well.

but if i go to http://mydomain.com/Mr_Nizzle it shows me the page of the user Mr_Nizzle which is on users#show (just like example) and as well for the other users to show every user’s page…

is it right if i go =>

match ':username' => 'users#show'

match 'contact_us' => 'main#contact'

match 'about' => 'main#about'

root :to => 'pages#main'

so i can leave all the logic on route instead of in the main controller?

Thanks.

  • 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-05-23T17:02:57+00:00Added an answer on May 23, 2026 at 5:02 pm

    I’m not sure exactly what your asking, however this may be of some help. I think (at least for about and contact) the correct syntax is match '/contact_us' => 'main#contact (the same for about but replace contact with about), the root :to => 'pages#main' is correct (that’s the same as doing match ‘/’ => ‘pages#main’)

    What are you asking about the match ':username' => 'users#show'? Do you want (for example) a url to be http://mydomain.com/users_username ? Where users_username is the name of the user’s profile that they are navigating to? If so, i think you can do something like match '/:username' => 'users#show' but i’m not entirely sure.

    Get back to me on what works and what doesn’t

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

Sidebar

Related Questions

I have a table of users which has a username column consisting of a
I have a table of users and each user has another user that they
I have a table users which has a primary key userid and a datetime
I have a user table 'users' that has fields like: id first_name last_name ...
My idea: I have a database of users, each user has an autoincremented id
In my addresses table, I have an field named isPrimary. For each address assigned
User has many Relationships In my relationships table i have a field :referee containing
Have a table called user_products that contains a record for each product the user
I have a table full of Actions. Each Action is done by a certain
I have voting system on my website, it stores each users vote in table

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.