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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Nicolas Cavigneaux
2006-Oct-03 09:30 UTC
Re: How do I get line breaks in my text fields and boxes?
Le 3 oct. 06 à 01:36, Dave a écrit :> > 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---