Hi everyone! Guys I am facing very irritating problem of line breaks in text area, i used "gsub" method to replace \r\n to <br/>, but i didn''t got the result as was i expecting. Could anybody give me any suggestions to resolve this issue? Thanks, Shahroon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 23 Feb 2009, at 13:07, shahroon ali wrote:> Guys I am facing very irritating problem of > line breaks in text area, i used "gsub" method to replace \r\n to > <br/>, but i didn''t got the result as was i expecting. > Could anybody give me any suggestions to > resolve this issue?<%= simple_format(@record.field_name) %> Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 gave me this <p>James, <br />Andy, <br />Candy</p> but i want line breaks like this James Andy Candy I hope now you can understand what my problem is. Thanks, Shahroon On Mon, Feb 23, 2009 at 5:10 PM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>wrote:> > On 23 Feb 2009, at 13:07, shahroon ali wrote: > > Guys I am facing very irritating problem of line > breaks in text area, i used "gsub" method to replace \r\n to <br/>, but i > didn''t got the result as was i expecting. > Could anybody give me any suggestions to resolve this > issue? > > > <%= simple_format(@record.field_name) %> > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sending again :) simple_format gave me this <p>James, <br />Andy, <br />Candy</p> but i want line breaks like this James Andy Candy I hope now you can understand what my problem is. Thanks, Shahroon On Mon, Feb 23, 2009 at 5:10 PM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>wrote:> > On 23 Feb 2009, at 13:07, shahroon ali wrote: > > Guys I am facing very irritating problem of line > breaks in text area, i used "gsub" method to replace \r\n to <br/>, but i > didn''t got the result as was i expecting. > Could anybody give me any suggestions to resolve this > issue? > > > <%= simple_format(@record.field_name) %> > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Sending again :)why? was 24 minutes of waiting too long?> I hope now you can understand what my problem is.no, not really. anyhow:> <p>James, <br />Andy, <br />Candy</p>this is actually what i thought you are trying to achieve after reading this:>i used "gsub" method to replace \r\n to <br/>now, i don''t know what your data looks like, but you surely could use split! to split a string into several parts and output the resulting array like this: names_array.each { |name| puts name } which would give you what you want:> James > Andy > Candy--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
:) , that was not an issue of waiting actually I thought my emails are going some where else due to this message of boxbe, so thats why. Now come to real issue, actually Mayer i have a text area for entering a list of developers or list of anything like this 1. Abcd 2. this is my second line 3. this is my third line now whenever i want to display this thing as a list it comes to me like a paragraph, i tried these simple_fromat(@vteam.developers) and simple_fromat(sanitize(@vteam.developers)) and (@vteam.developers).gsub("\r\n","<br/>") but none these worked. Thanks, Shahroon On Mon, Feb 23, 2009 at 6:11 PM, MaD <mayer.dominik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Sending again :) > why? was 24 minutes of waiting too long? > > > I hope now you can understand what my problem is. > no, not really. > > anyhow: > > > <p>James, <br />Andy, <br />Candy</p> > this is actually what i thought you are trying to achieve after > reading this: > >i used "gsub" method to replace \r\n to <br/> > > now, i don''t know what your data looks like, but you surely could use > split! to split a string into several parts and output the resulting > array like this: > > names_array.each { |name| puts name } > > which would give you what you want: > > James > > Andy > > Candy > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Okay thanks, I got the solution. thats simply (@vteam.developers).gsub("\n","<br/>") Shahroon On Mon, Feb 23, 2009 at 6:33 PM, shahroon ali <shahroon.ali-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> :) , that was not an issue of waiting actually I thought my emails are > going some where else due to this message of boxbe, so thats why. > > Now come to real issue, actually Mayer i have a text area for entering a > list of developers or list of anything like this > 1. Abcd > 2. this is my second line > 3. this is my third line > now whenever i want to display this thing as a list it comes to me like a > paragraph, > i tried these > simple_fromat(@vteam.developers) > and > simple_fromat(sanitize(@vteam.developers)) > and > (@vteam.developers).gsub("\r\n","<br/>") > but none these worked. > > Thanks, > Shahroon > > > On Mon, Feb 23, 2009 at 6:11 PM, MaD <mayer.dominik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> > Sending again :) >> why? was 24 minutes of waiting too long? >> >> > I hope now you can understand what my problem is. >> no, not really. >> >> anyhow: >> >> > <p>James, <br />Andy, <br />Candy</p> >> this is actually what i thought you are trying to achieve after >> reading this: >> >i used "gsub" method to replace \r\n to <br/> >> >> now, i don''t know what your data looks like, but you surely could use >> split! to split a string into several parts and output the resulting >> array like this: >> >> names_array.each { |name| puts name } >> >> which would give you what you want: >> > James >> > Andy >> > Candy >> >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Why don''t you just do a team has_many developers and add a text_field with developers that can be added??? Entering the developers in a text area as a list does not sound like a good idea... If you had many developers you would just create the list with team.developers.each and you are golden... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I know you are right, and I convinced my client as well but he insist me to do like this. Thanks, Shahroon On Mon, Feb 23, 2009 at 9:18 PM, Freddy Andersen <freddy-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org>wrote:> > Why don''t you just do a team has_many developers and add a text_field > with developers that can be added??? Entering the developers in a text > area as a list does not sound like a good idea... > > If you had many developers you would just create the list with > team.developers.each and you are golden... > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---