Created
February 7, 2011 20:59
-
-
Save DCarper/815199 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| - form_for [@bracket, @bracket.guess_for(user)], :html => {:method => :delete, :class => 'destroy_guess'} do |f| | |
| = f.submit "Delete Guess" |
This file contains hidden or 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
| $(function() { | |
| $(".destroy_guess").destroyGuesses() | |
| }) | |
| $.fn.destroyGuesses = function() { | |
| $(this).submit( function() { | |
| $container = $(this).parent(); | |
| $.ajax({ url: this.action + '.json', | |
| data: $(this).serialize(), | |
| type: 'post', | |
| success: function(data, textStatus, XMLHttpRequest){ | |
| $("#flash").text(data.notice); | |
| $container.html(disabled_button) | |
| }}) | |
| return false; | |
| }) | |
| return $(this); | |
| } |
This file contains hidden or 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
| <form method="post" id="edit_guess_47" class="destroy_guess" action="/insider/brackets/2/guesses/47"> | |
| <div style="margin: 0pt; padding: 0pt; display: inline;"> | |
| <input type="hidden" value="delete" name="_method" disabled=""> | |
| <input type="hidden" value="Rr68PIJ8eZ7/U7gWy6XPM1fK5m9mWlCLu9yB39C38Z8=" name="authenticity_token" disabled=""> | |
| </div> | |
| <input type="submit" value="Delete Guess" name="commit" id="guess_submit"> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment