Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created May 20, 2011 18:10
Show Gist options
  • Select an option

  • Save meltzerj/983446 to your computer and use it in GitHub Desktop.

Select an option

Save meltzerj/983446 to your computer and use it in GitHub Desktop.
def heard
if params[:state] == 'yes'
@heard = true
elsif params[:state] == 'no'
@heard = false
end
respond_to do |format|
if ShowableVideo.find_by_id(params[:showable_video_id]).update_attributes(:heard => @heard)
format.html { redirect_to :back }
format.js
else
format.html { redirect_to :back }
format.js
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment