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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:58:42+00:00 2026-06-06T06:58:42+00:00

Having an interesting issue with redirects. On my user update page (at /username/edit), users

  • 0

Having an interesting issue with redirects. On my user update page (at /username/edit), users can update their name, email and username. Once the update is complete, if the user updates their username, the path that they are redirected (in this case, its edit_user_path causes an error:

Cannot redirect to nil!

My Users controller looks like this:

def update
    find_user

    if @user.update_attributes(params[:user])
        sign_in @user
        flash[:success] = "User updated"
        redirect_to edit_user_path
    else
        flash[:notice] = "There was an error updating this user:"
        redirect_to edit_user_path
    end
end

find_user is a method to find @user.

Essentially, how do I force the routes to update once this update happens?

  • 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-06T06:58:44+00:00Added an answer on June 6, 2026 at 6:58 am

    Perhaps try:

    edit_user_path(@user)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been having an interesting issue with the Eclipse update when some of
Having an interesting issue. I'm reading from an excel file on a server via
Ok, so I was having a very interesting issue with CakePHP 1.3, in that
I'm having an interesting issue with Leptonica that I'm wondering if other SO members
I'm having an interesting JNA issue here. Under JRE 1.6 and 1.7 x64, I
Today I faced an interesting issue. I've been having an inheritance hierarchy with Hibernate
Happy Friday. Having an interesting time debugging a zombie issue. I have a UITableView
I'm having an interesting issue with gcc 4.5.2. The following code #include<thread> #include<iostream> using
Folks, I'm having an interesting issue with Silverlight DataGrid data binding. It may be
I've been having an issue with URL Rewriting and Postbacks. Edit: Currently using IIS

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.