Instantly share code, notes, and snippets.

Embed
What would you like to do?
<form method="post" action="/posts">
<input type="hidden" name="_method" value="put">
<input type="text" name="title">
<textarea name="content"></textarea>
<input type="submit" value="Save">
</form>
function makePutReq( url ){
var xhr = new XMLHttpRequest();
xhr.open( 'PUT', url, false );
xhr.setRequestHeader( 'Content-Type', 'text/plain' );
xhr.send( null );
}
<%= link_to refresh_post_user_post_path(@user,@post), :method => :put%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment