How do I get line breaks in my text fields and boxes?

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?

Thanks in advance!

Dave

Le 3 oct. 06 à 01:36, Dave a écrit :

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 C.
http://www.bounga.org
http://www.cavigneaux.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs