Created
July 27, 2013 20:11
-
-
Save cmilfont/6096119 to your computer and use it in GitHub Desktop.
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
//clicar no botao gerar um form | |
// mapear o submit do form | |
// enviar o json para o servidor | |
// exibir uma mensagem de volta | |
(function($){ | |
var tpl = Mustache.compile("{{name}} created at {{created_at}}"); | |
$.fn.extend({ | |
create: function(config){ | |
var $this = $(this); | |
$this.reveal(); | |
$this.find("#graduate_button").click(function(){ | |
var json = $this.getJSON(); | |
config.controller.create(json, function(team){ | |
$this.html( tpl(team) ); | |
}); | |
}); | |
return false; | |
} | |
}) | |
})(jQuery); | |
$("#bjjcreate").create( {controller: new TeamsController} ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment