use @like.target instead of @target, build should be green

This commit is contained in:
Dan Hansen 2011-08-26 16:08:29 -05:00
parent 20b4304f23
commit d084c708b6
2 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ class LikesController < ApplicationController
end
def destroy
if target && @like = Like.where(:id => params[:id], :author_id => current_user.person.id).first
if @like = Like.where(:id => params[:id], :author_id => current_user.person.id).first
current_user.retract(@like)
respond_to do |format|
format.all { }

View file

@ -1,2 +1,2 @@
$(".like_action", "#<%=@target.guid%>").first().html("<%= escape_javascript(like_action(@like.target))%>");
ContentUpdater.addLikesToPost("<%=@like.target.guid%>", "<%= escape_javascript(render("likes/likes_container", :target_id => @like.target_id, :likes_count => @target.reload.likes_count, :target_type => @like.target_type)) %>");
$(".like_action", "#<%=@like.target.guid%>").first().html("<%= escape_javascript(like_action(@like.target))%>");
ContentUpdater.addLikesToPost("<%=@like.target.guid%>", "<%= escape_javascript(render("likes/likes_container", :target_id => @like.target_id, :likes_count => @like.target.reload.likes_count, :target_type => @like.target_type)) %>");