This code is written in a controller method.
@votetype="up"
@video = Video.find(params[:vid])
@video.up -= 1
@video.total -= 1
@video.save
ld.ld = 0
ld.save
respond_to do |format|
format.js
end
How do I access @votetype
in a .js.erb
file inside an if
condition?