bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 571 forks source link

Field as: :date doesn't work #453

Open sjchmiela opened 9 years ago

sjchmiela commented 9 years ago

When using best_in_place as: :date on click browser responds with Javascript error:

TypeError: undefined is not an object (evaluating 'BestInPlaceEditor.forms[this.formType].activateForm')
stereodenis commented 9 years ago

@sjchmiela could you provide a sample app with this bug?

liaden commented 9 years ago

I am running into this while updating from rails 3.2.x to 4.0.x. This section of code (https://github.com/bernat/best_in_place/blob/d98dd1f5a7cb3ba20f74c9ba21ac2b2c58fb2ca9/lib/assets/javascripts/best_in_place.js#L363) matches what I am seeing in the console:

BestInPlaceEditor.forms
Object {input: Object, select: Object, checkbox: Object, textarea: Object}

It looks like https://github.com/bernat/best_in_place/blob/fd40a44656ef01425799d7e34e848057887c324e/lib/assets/javascripts/best_in_place.jquery-ui.js#L9 is where date behavior is specified.

liaden commented 9 years ago

Fixed by adding //= require best_in_place.jquery-ui to app/assets/javascripts/application.js.