Skip to content

Instantly share code, notes, and snippets.

@data-doge
Last active August 29, 2015 14:15
Show Gist options
  • Save data-doge/3b0f59e0f8f3f4d42385 to your computer and use it in GitHub Desktop.
Save data-doge/3b0f59e0f8f3f4d42385 to your computer and use it in GitHub Desktop.
little crud hax
<!-- 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