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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:13:17+00:00 2026-06-07T08:13:17+00:00

I have a User model with name, email, password, and bio. I want to

  • 0

I have a User model with name, email, password, and bio.

I want to have two kinds of edit forms. One for editing email, bio and the other for just password.

So my question is really two parts.

A) If the update_attributes fails in update method, how to render the correct page, instead of just edit. This is my current update method.

def update
  if @user.update_attributes(params[:user])
    flash[:success] = "Profile updated"
    sign_in @user
    redirect_to @user
  else
    render 'edit'
  end
end

B) How do I have route like /users/1/edit for change_password method? So I want something like /users/1/change_password.


B) match '/users/:id/change_password', to: 'users#change_password' did the job.

  • 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-07T08:13:20+00:00Added an answer on June 7, 2026 at 8:13 am

    redirect_to edit_user_path(@user)

    Should work.

    Also I would change your change_password routes to be like this:

    resource :users do
      member do
        put 'change_password'
      end
    end
    

    Which is a more Rails-y way of doing things. Then, you can do

    redirect_to change_password_user_path(@user)

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

Sidebar

Related Questions

I have a typical User model (username, password, name, etc). I want to allow
I have a User Model(:name, :password, :email), and Event model(:name, :etc) and Interest model
I have a User Model(:name, :password, :email), and Event model(:name, :etc) and Interest model
My User model contains :name, :email, and :password fields. All 3 have validations for
I have two models: User (email:string) Profile (name:string) class User < ActiveRecord::Base has_one :profile
I'm starting with yii. I have the following DB structure: Table: Rows: user [id,login,password,name,email]
I have a User model that has among other things an email and a
I have a User model with the usual information (login, email, name, location, etc).
i have a User model and some common columns, such as name , email
I have a user model: class User < ActiveRecord::Base attr_accessible :email, :name # admin

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.