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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:55:06+00:00 2026-05-27T20:55:06+00:00

I have one model User with Devise gem. I added a new field called

  • 0

I have one model User with Devise gem. I added a new field called budget.

Users
id | name | password | ... | budget 

I have a file _form_edit.erb.html which is different from _form.erb.html.

_form_edit to update the profile with budget field.
_form to create process for devise.

users_controller.erb

  def update
    @user = User.find(params[:id])
    respond_to do |format|
      if @user.update_attributes(params[:user])
        format.html { redirect_to @user, notice: 'User was successfully updated.' }
        format.json { head :ok }
      else
        format.html { render action: "edit" }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end

How to prevent devise gem from logging out when I update budget in my profile?

  • 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-27T20:55:06+00:00Added an answer on May 27, 2026 at 8:55 pm

    You can imporvise on the way mentioned in the link below about controlling the redirect after a User (Devise model is updated).

    https://github.com/plataformatec/devise/wiki/How-To:-Customize-the-redirect-after-a-user-edits-their-profile

    Also you might have to ensure that you skip the regular Devise authentication (its a before filter which you can override I think) to ensure you take control of it using your own before filter).

    Another probably cleaner but more painful way is to spilt your model into User and (something like) UserInformation, where you can have a one-to-one relationship with User. You can maintain all non auth related information about a User in this model, and treat it like other Models in the system. This approach is better in case ‘budget’ is not just a one of thing and you have a lot more information in your User Profile.

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

Sidebar

Related Questions

I have one Devise model: User. I am needing two different login views, /login
I have a User model that Devise manages - i.e. all users have email
I am relatively new to Rails. I have a User model through Devise. I
I'd like to have access to one my model field verbose_name. I can get
I am using Devise in Rails 3, and have a User model in rails
I have a User model with devise, a Team model, a Player model and
I have a User model, which belongs to Profile (belongs_to polymorphic). One model comes
I have post and user model and I have Many( posts ) to One(
it's possible to have one entity object (class, e.g. User) for more entity models
I have one grails application.In that I have one model class named Book. From

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.