Skip to content

Commit

Permalink
fixed user profile updation
Browse files Browse the repository at this point in the history
  • Loading branch information
swatijadhav committed May 28, 2014
1 parent fce8961 commit 6d54cf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Expand Up @@ -31,6 +31,7 @@ def edit
#----------------------------------------------------------------------------
def update
@user.update_attributes(params[:user])
flash[:notice] = t(:profile_update)
respond_with(@user)
end

Expand Down
5 changes: 3 additions & 2 deletions app/models/users/user.rb
Expand Up @@ -41,8 +41,9 @@ class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :confirmable,
:encryptable, :recoverable, :rememberable, :trackable, stretches: 20

attr_accessible :username, :email, :password, :password_confirmation, :remember_me,
:first_name, :last_name, :title, :company, :group_ids
attr_accessible :username, :email, :password, :password_confirmation,
:remember_me, :first_name, :last_name, :title, :company, :group_ids,
:alt_email, :phone, :mobile, :aim, :yahoo, :google, :skype

before_create :check_if_needs_approval
before_destroy :check_if_has_related_assets
Expand Down
2 changes: 2 additions & 0 deletions app/views/users/update.js.haml
@@ -1,6 +1,8 @@
- if @user.errors.empty?
crm.flip_form('edit_profile');
crm.set_title('edit_profile', '#{j t(:my_profile)}');
$('#flash').html('#{ j flash[:notice] }');
crm.flash('notice')
$('#welcome_username').html('#{j current_user.name}');
$('#profile').html('#{ j render(:partial => "user") }');
- else
Expand Down

0 comments on commit 6d54cf2

Please sign in to comment.