-
-
Save eriknomitch/4171423 to your computer and use it in GitHub Desktop.
Herro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In concepts.js | |
function newTag (){ | |
$.ajax({ | |
type: "POST", | |
url: "/tags/create", | |
data: {"tag[seconds]": player.getCurrentTime(), "concept_name": "Cross Product"}, | |
success: function(data) { | |
alert("supposed success:"+data); | |
} | |
}); | |
} | |
# In tags.controller.rb | |
def create | |
@concept_name = params[:concept_name] | |
@concept = Concept.find_by_name(@concept_name).first | |
@concept.save | |
@tag = Tag.new(params[:tag]) | |
@tag.video = Video.last | |
@tag.concept = @concept | |
@tag.ranker = 0 | |
@tag.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment