Last active
January 3, 2016 03:29
-
-
Save pasupulaphani/8402603 to your computer and use it in GitHub Desktop.
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
<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> | |
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
function makePutReq( url ){ | |
var xhr = new XMLHttpRequest(); | |
xhr.open( 'PUT', url, false ); | |
xhr.setRequestHeader( 'Content-Type', 'text/plain' ); | |
xhr.send( null ); | |
} |
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
<%= 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