I'm creating a simple recipe application, and I want to preserve the
line breaks when a user hits "enter" between ingredients and directions.
However, when I submit a recipe now it all shows up on one line. Is
there a simple way to preserve these user-generated line breaks? As a
followup, is it much harder to change those line breaks into ordered
lists?
Thanks in advance!
Dave
--
Posted via http://www.ruby-forum.com/.
>
> Hi, I'm new to programming and Ruby on Rails, hence this probably
> simple
> question.
>
> I'm creating a simple recipe application, and I want to preserve the
> line breaks when a user hits "enter" between ingredients and
> directions.
> However, when I submit a recipe now it all shows up on one line. Is
> there a simple way to preserve these user-generated line breaks? As a
> followup, is it much harder to change those line breaks into ordered
> lists?
You should try simple_format("your text") to preserve line breaks.
You can easily translate line breaks to list using String.gsub.
--
Nicolas Cavigneaux
http://www.bounga.org
http://www.cavigneaux.net