Hi, I am a newbie to rails and have a problem to solve. I have textarea which provides as input Line1 Line2 Line3 I want this content to be split into an array using "\r\n" as the seperators. I tried to do the split directly on params[:content].split("\r\n") but got an error which says called a private method of HASH. I convert params[:content].to_s then I guess my \r\n''s are lost. How do I get this split working? Regards, Sudhi -- 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''re probably calling the method at the wrong param. Show the form you''re using. - MaurĂcio Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Tue, Mar 3, 2009 at 11:27 AM, Sudhi Kulkarni <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > > I am a newbie to rails and have a problem to solve. I have textarea > which provides as input > > Line1 > Line2 > Line3 > > I want this content to be split into an array using "\r\n" as the > seperators. > I tried to do the split directly on params[:content].split("\r\n") but > got an error which says called a private method of HASH. > > I convert params[:content].to_s then I guess my \r\n''s are lost. > > How do I get this split working? > > Regards, > Sudhi > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 3, 2009 at 8:27 AM, Sudhi Kulkarni <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I tried to do the split directly on params[:content].split("\r\n") but > got an error which says called a private method of HASH. > > I convert params[:content].to_s then I guess my \r\n''s are lost. > > How do I get this split working?params[:content].split("\r\n") works for me. Post more code. -- Greg Donald http://destiney.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 -~----------~----~----~----~------~----~------~--~---