I am using best_in_place gem to do some inline editing in a Rails app.
One of the property of my object is of type text
, and I want it to be edited in a text area, so I did this:
<%= best_in_place @myobject, :description, :type => :textarea %>
It works, but when not being edited, all returns (\n) are removed.
I tried using simple_format, by adding :display_with => :simple_format
to the options passed to best_in_place:
<%= best_in_place @myobject, :description, :type => :textarea, :display_with => :simple_format %>
When not being edited, the new lines are displayed as expected. But the click to enter edition is broken, and a new dash is added above. Clicking it display a textarea box, but it is empty, and the text entered there is not saved back to my object.
The content saved in my property is just plain text, it does not contain any html.
This issue (and patch) seemed related to my problem: https://github.com/bernat/best_in_place/pull/111
However, when applying the patch (manually, to the file .../gems/best_in_place-1.0.6/spec/spec_helper.rb
), I still have the same problem.