Skip to content

Instantly share code, notes, and snippets.

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">
function makePutReq( url ){
var xhr = new XMLHttpRequest(); '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