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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:23:53+00:00 2026-06-13T01:23:53+00:00

Currently I have a rails app where user profiles are viewed at /users/:id, but

  • 0

Currently I have a rails app where user profiles are viewed at “/users/:id”, but I want to change that to “/:username”. I’ve fixed the rails routes so that I have “match ‘/:username’, :to => ‘users#show’, but I want to make it so I can easily use “redirect_to @user” within the controllers so that it goes to this new route. This still currently goes to “/users/:id”.

How would I go about editing the default route?

  • 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-13T01:23:55+00:00Added an answer on June 13, 2026 at 1:23 am

    If you add to your match line the following: “:as => user_path” I think it would work, but I don’t know if it would conflict with the already existing one… probably created by devise…

    A bit more on this: As far as I know (I may be wrong here), redirect_to @user, just calls user_path(@user). So if you create a new url helper called user_path, then it should work as you expect it to work.

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

Sidebar

Related Questions

Currently I have a Rails 3 app that subscribes new users up to MailChimp.
I currently have a rails app and each user has a profile that has
I have a rails app with Devise 1.4.9. Currently, it allows only users from
I'm building an app in Rails 3. I currently have a user model which
I currently have an app that when a user signs up, it is being
Some of the users of our Ruby on Rails app have complained that page
I have a rails 3 app that displays user submissions in order of how
Let's say I have a Rails 3 app that displays videos. The user can
I have a rails app which currently has 3 models: Post , User and
I have a Rails app with a user model that contains an admin attribute.

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.