我需要将两个实例变量传递给正在由ajax请求用来更新用户显示的JavaScript文件。这是我需要做的:将两个实例变量传递给js.erb文件?
respond_to do |format|
if @post.save
format.js { @post @user_vote } # <-- right here
else
format.html { redirect_to :back, :alert => 'There was an error in removing the vote' }
end
end
这是如何完成的?