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 4024068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:40:33+00:00 2026-05-20T10:40:33+00:00

I have a Rails 3 question. I want to get my users controller show

  • 0

I have a Rails 3 question. I want to get my users controller show page to have the app.com/people/username url.

Route

resources :users  
match "/people/:username" => 'users#show', :as => :profile

It’s work, but if username starts with “.” (dot) I have an error:

No route matches “/people/.G”

And

<%= link_to current_user.username, profile_path(current_user.username) %>

raise an exception:

No route matches {:controller=>”users”, :action=>”show”, :username=>”.G”}

Sorry for my English, 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-20T10:40:33+00:00Added an answer on May 20, 2026 at 10:40 am

    I don’t think starting with . is supported by default in rails routes. You can do something like

    match "/people/:username" => 'users#show', :as => :profile, :username => /[\.a-zA-Z0-9_]+/
    

    The above regex will match ., a-z, A-Z, 0-9 and _ as valid characters for the username.

    • 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 running on port 3000. The page in question has
I have a Rails question. How do I get a controller action's name inside
Rails 3.1 I'll simplify my application to get at my question. I have two
In my Rails app I have Users. Users are asked for their home city
I'm using devise in my rails 3.2 application. I have a users/new page where
I have a single Rails 2.2.2 app that I want to 'share' with multiple
BACKGROUND : I have a Rails app where my home page is products/index. I'm
A bit of a newbie question on rails associations. I have a Bug model,
I have a question about ruby on rails and the process of assigning variables
I have a prototype question in the context of Ruby on Rails. QUESTION -

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.