Forum: Ruby on Rails only able to update email but fname etc not updating

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7ef5d973297a0843651aaa9c92b24a08?d=identicon&s=25 Baba Bobo (bababobo)
on 2008-11-10 21:54
Attachment: users_controller.rb (1 KB)
I am using Restful_Authentication plugin for login/logout. I am trying
to update the profile page which has columns email and fname etc, its
updating only the email column but not updating the fname and other
columns once i hit save and gives me flash message as 'Profile was
successfully updated. Please let me know how can i fix it to update all
fields not just email field.

-- following is the code in my users_controller.rb :-

class UsersController < ApplicationController
  # render new.rhtml
  def new
    @title = 'new'
  end

 def create
    cookies.delete :auth_token
    # protects against session fixation attacks, wreaks havoc with
    # request forgery protection.
    # uncomment at your own risk
    # reset_session
    @user = User.new(params[:user])
    @user.save
    if @user.errors.empty?
      self.current_user = @user
      redirect_back_or_default('/session/new')
      flash[:notice] = "Thanks for signing up!"
    else
      render :action => 'new'
    end
  end

  def update
    @user = User.find(params[:id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        flash[:notice] = 'Profile was successfully updated.'
        format.html { redirect_to :controller => 'sessions', :action =>
'edit_profile' }
        format.xml  { head :ok }
      else
        flash[:error] = 'Unable to update profile.'
        format.html { render :controller => 'sessions', :action =>
'edit_profile' }
        format.xml  { render :xml => @user.errors, :status =>
:unprocessable_entity }
      end
    end
  end

  def edit
    @user = User.find(params[:id])
  end

end

-- following is the code in my edit_profile.html.erb file located in
(views/sessions/edit_profile):-

<h2> Edit Profile </h2>
<% form_for @current_user do |f| %>
<%= f.error_messages %>

  <p>
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </p>
  <p>
    <%= f.label :fname %><br />
    <%= f.text_field :fname %>
  </p>
  <p>
    <%= f.label :middle_name %><br />
    <%= f.text_field :mname %>
  </p>
  <p>
    <%= f.label :last_name %><br />
    <%= f.text_field :lname %>
  </p>
  <p>
    <%= f.submit "Save" %>
  </p>
<% end %>
7ef5d973297a0843651aaa9c92b24a08?d=identicon&s=25 Baba Bobo (bababobo)
on 2008-11-10 21:55
Attachment: sessions_controller.rb (1 KB)
attached is my sessions_controller.rb (its is mostly generated by
restfull authentication plugin)
This topic is locked and can not be replied to.