Monday, June 22, 2009

inplace editor and restful

while working on scrumpad the next generation project management tools for scrum we stated that project on ROR 1.8.6. while we decided to update the project to ROR 2.3.2 and make it restful at this time we found that inplace editor is not working for update or edit. because its default method is set to 'get'. So we have to change the following lines of the controls.js under the public/javascript folder to make it workable with the restful architecture.

handleFormSubmission: function(e){

// these lines we have changed of this method (line 636)
new Ajax.Updater({ success: this.element }, this.url, options);
} else {
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
}

to
handleFormSubmission: function(e){

// after changing
new Ajax.Updater({ success: this.element }, this.url, options);
} else {
var options = Object.extend({ method: ((this.options.method != null) ? this.options.method.toString() : 'get') }, this.options.ajaxOptions);

}
and its works fine. for inplace editor with the restful for updating a value.

No comments: