ruby on rails 3 - Using simple_format somehow modifies a models attribute in-place -
It's weird that I have a page which is a comment feature on an example of simple_format model though on the same page This is a form that allows updating this comment. When I simplify the attribute, this feature is shown in the modified form (i.e., with paragraph tags etc.) in the form.
I can not see how this is happening, unless there is any modification in the simpler format format that has a feature in place but how can this happen when it executes:
simple_format @ warranty.comments Output:
& lt; P & gt; Here are some comments & lt; / P & gt; and in the form below and below the page, even if we just call:
@ warranty.comments We receive:
& lt; P & gt; Here are some comments & lt; / P & gt; If I change it:
simple_format @ warranty.comments.clone the behavior goes away
Is there anything clear to me here? Unless it was called as @ warranty.comments.simple_format, I would not expect to modify the original feature of a text assistant!
It was a bug that was. The latest 3.1.0 should be fine, but I'm not sure about other versions.
Comments
Post a Comment