bootstrap-ruby / bootstrap-editable-rails

In-place editing with Twitter Bootstrap for Rails
http://rubygems.org/gems/bootstrap-editable-rails
MIT License
216 stars 52 forks source link

204 response from server should not add .editable-unsaved css class to <a> #21

Closed KeithP closed 9 years ago

KeithP commented 10 years ago

On update the Rails controller correctly responds with 204 No Content, but the "editable-unsaved" css class is added to the anchor tag.

Using Rails 4.1, ruby 1.9.1, jquery-rails-3.1.0, bootstrap 3

tkawa commented 10 years ago

Thank you for reporting :smile: It seems an X-editable's bug.

It will work by this fix:

https://github.com/bootstrap-ruby/bootstrap-editable-rails/blob/master/vendor/assets/javascripts/bootstrap-editable.js#L1845

-                sent = sent || (this.options.savenochange && this.input.value2str(this.value) !== this.input.value2str(params.newValue));
+                sent = sent || (this.input.value2str(this.value) !== this.input.value2str(params.newValue));

It should be fixed on the original source, so I'll send a pull request to X-editable. Meanwhile, please try this fix.