Take out another couple friends.first and replace with friend_by_id
This commit is contained in:
parent
4f22222b30
commit
d7a9c3c087
2 changed files with 2 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class ApplicationController < ActionController::Base
|
||||||
@groups = current_user.groups
|
@groups = current_user.groups
|
||||||
@friends = current_user.friends
|
@friends = current_user.friends
|
||||||
@latest_status_message = StatusMessage.newest_for(current_user.person)
|
@latest_status_message = StatusMessage.newest_for(current_user.person)
|
||||||
@group = params[:group] ? current_user.groups.first(:id => params[:group]) : current_user.groups.first
|
@group = params[:group] ? current_user.group_by_id(params[:group]) : current_user.groups.first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class PeopleController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
current_user.unfriend(current_user.friends.first(params[:id]))
|
current_user.unfriend(current_user.friend_by_id(params[:id]))
|
||||||
flash[:notice] = "unfriended person."
|
flash[:notice] = "unfriended person."
|
||||||
redirect_to people_url
|
redirect_to people_url
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue