Fix profile pic getting unset on profile update
This commit is contained in:
parent
41aa8ed10e
commit
1faaf1dd81
3 changed files with 3 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@user = User.first(:id => params[:id])
|
||||
@user = current_user
|
||||
@person = @user.person
|
||||
@profile = @user.profile
|
||||
@photos = Photo.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
module GroupsHelper
|
||||
def link_for_group( group )
|
||||
puts request.params
|
||||
link_to group.name, group
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -123,6 +123,8 @@ class User
|
|||
|
||||
########### Profile ######################
|
||||
def update_profile(params)
|
||||
params[:profile].delete(:image_url) if params[:profile][:image_url].empty?
|
||||
|
||||
if self.person.update_attributes(params)
|
||||
self.profile.push_to( self.friends.all )
|
||||
true
|
||||
|
|
|
|||
Loading…
Reference in a new issue