Created
July 8, 2011 21:30
-
-
Save jejacks0n/1072870 to your computer and use it in GitHub Desktop.
Creating content with Mercury by overriding save.
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
new Mercury.PageEditor('/path/to/your/controller'); | |
Mercury.PageEditor.prototype.save = function() { | |
jQuery.ajax(this.saveUrl, { | |
type: 'POST', | |
data: {content: jQuery.toJSON(this.serialize()), _method: 'put'}, | |
success: function() { Mercury.changes = false }, | |
error: function() { alert("Mercury was unable to save to the url: " + this.saveUrl) } | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment