Skip to content

Instantly share code, notes, and snippets.

Created November 29, 2012 19:53
Show Gist options
  • Save anonymous/4171420 to your computer and use it in GitHub Desktop.
Save anonymous/4171420 to your computer and use it in GitHub Desktop.
Herro
In concepts.js
function newTag (){
$.ajax({
type: "POST",
url: "/tags/create",
data: {"tag[seconds]": player.getCurrentTime(), "tag[concept_name]": "Cross Product"},
success: function() {
alert("supposed success");
}
});
}
In tags.controller.rb
def create
@tag_concept_name = params[:tag][:concept_name]
params[:tag].delete :concept_name
@tag = Tag.new(params[:tag])
@tag.video = Video.last
@tag.concept = Concept.where(:name => @tag_concept_name)
@tag.ranker = 0
@tag.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment