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
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@user = User.first(:id => params[:id])
|
@user = current_user
|
||||||
@person = @user.person
|
@person = @user.person
|
||||||
@profile = @user.profile
|
@profile = @user.profile
|
||||||
@photos = Photo.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
@photos = Photo.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
module GroupsHelper
|
module GroupsHelper
|
||||||
def link_for_group( group )
|
def link_for_group( group )
|
||||||
puts request.params
|
|
||||||
link_to group.name, group
|
link_to group.name, group
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,8 @@ class User
|
||||||
|
|
||||||
########### Profile ######################
|
########### Profile ######################
|
||||||
def update_profile(params)
|
def update_profile(params)
|
||||||
|
params[:profile].delete(:image_url) if params[:profile][:image_url].empty?
|
||||||
|
|
||||||
if self.person.update_attributes(params)
|
if self.person.update_attributes(params)
|
||||||
self.profile.push_to( self.friends.all )
|
self.profile.push_to( self.friends.all )
|
||||||
true
|
true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue