I use text_area_tag in a view page and when its action get its value by params[:id], all the newline will be removed. How can I keep the format of textarea? -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
You should not try that because the text area is designed to wrap text automatically - there really are not new line characters in the text area, unless you manually inserted them. In that case, they should remain. On Jan 7, 9:21 pm, Zhao Yi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I use text_area_tag in a view page and when its action get its value by > params[:id], all the newline will be removed. How can I keep the format > of textarea? > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
srj wrote:> You should not try that because the text area is designed to wrap text > automatically - there really are not new line characters in the text > area, unless you manually inserted them. In that case, they should > remain.I have input "\n" at each line of the text, but it doesn''t work. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
simple_format(your_text_here) ----- Ryan Bigg Freelancer http://frozenplague.net On 08/01/2009, at 1:00 PM, Zhao Yi wrote:> > srj wrote: >> You should not try that because the text area is designed to wrap >> text >> automatically - there really are not new line characters in the text >> area, unless you manually inserted them. In that case, they should >> remain. > > I have input "\n" at each line of the text, but it doesn''t work. > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg wrote:> simple_format(your_text_here) > ----- > Ryan Bigg > Freelancer > http://frozenplague.netIn this way, I have to write \n in the textarea which is not a good user interface. How can I do some background job to replace the textarea before it is submitted? -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
no, you don''t have to write the \n. When people type new lines it automatically puts in the \n, or in some cases a \r\n. This means simple_format will work. ----- Ryan Bigg Freelancer http://frozenplague.net On 08/01/2009, at 1:18 PM, Zhao Yi wrote:> > Ryan Bigg wrote: >> simple_format(your_text_here) >> ----- >> Ryan Bigg >> Freelancer >> http://frozenplague.net > > In this way, I have to write \n in the textarea which is not a good > user > interface. How can I do some background job to replace the textarea > before it is submitted? > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg wrote:> no, you don''t have to write the \n. > > When people type new lines it automatically puts in the \n, or in some > cases a \r\n. > > This means simple_format will work. > ----- > Ryan Bigg > Freelancer > http://frozenplague.netthanks it works. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---