Last active
August 29, 2015 14:15
-
-
Save data-doge/3b0f59e0f8f3f4d42385 to your computer and use it in GitHub Desktop.
little crud hax
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
<!-- sinatra only support HTTP verbs GET and POST, so to implement PUT + DELETE HTTP verbs we need to hack a little bit--> | |
<form action='/tweets/<%=tweet.id%>' method='post'> | |
<input type='hidden' name='_method' value='delete' /> | |
<!-- here, we have a hidden input which magically turns this post request into a delete request. how nice. --> | |
<input type='submit' value='X' /> | |
</form> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment