Skip to content

Instantly share code, notes, and snippets.

@felippemr
Created December 4, 2013 18:10
Show Gist options
  • Save felippemr/7792510 to your computer and use it in GitHub Desktop.
Save felippemr/7792510 to your computer and use it in GitHub Desktop.
projects.js.coffee e project.js
JQuery ->
$('form').on 'click' , '.remove_fields', (event) ->
$(this).prev('input[type=hidden]').val(1)
$(this).closest('fieldset').hide()
event.preventDefault()
Depois de gerado ele fica assim:
(function() {
JQuery(function() {
return $('form').on('click', '.remove_fields', function(event) {
$(this).prev('input[type=hidden]').val(1);
$(this).closest('fieldset').hide();
return event.preventDefault();
});
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment