Forum: Ruby on Rails simple_format and in_place_editor_field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rodrigo A. (Guest)
on 2006-01-04 19:13
(Received via mailing list)
Hi!

How can i do to force an in_place_editor_field to format the text with
simple_format while not editing?

Thanks.
ImNotQuiteJack (Guest)
on 2007-02-06 17:31
If anyone is still looking for the answer to this question, here's my
solution: use the in_place_editor helper instead.

<code>
<div id="the_text"><%= simple_format @the_text_string %></div>
<%= in_place_editor "the_text", { :rows => 2, :cols => 80 } %>
</code>
Wai T. (Guest)
on 2007-03-09 22:15
ImNotQuiteJack wrote:
> If anyone is still looking for the answer to this question, here's my
> solution: use the in_place_editor helper instead.
>
> <code>
> <div id="the_text"><%= simple_format @the_text_string %></div>
> <%= in_place_editor "the_text", { :rows => 2, :cols => 80 } %>
> </code>

If you use this, the formatting will be saved as well.  This is not
feasible at all if the text has multiple lines, since saving it like
this will create blank lines.
This topic is locked and can not be replied to.