我需要將兩個實例變量傳遞給正在由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
這是如何完成的?