how to set a maximum length for text area in rails -- 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 -~----------~----~----~----~------~----~------~--~---
Russell Norris
2007-Mar-20 14:07 UTC
Re: how to set a maximum length for text area in rails
Have you checked out the API at http://api.rubyonrails.org/ ? It''s really handy and it''s free. Also there are quite a few good books you can get to learn Ruby on Rails. I highly recommend Agile Web Development with Rails [2nd Edition]. RSL On 3/20/07, Shiva Shiva <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > how to set a maximum length for text area in rails > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Shiva Shiva wrote:> how to set a maximum length for text area in rails<label for="profile_comment">Comment:</label><br /> <%= f.text_area :comment, :cols => 30, :rows => 5 %> When did forum members get so narky and unwilling to help? It would have taken less characters to provide the answer than to give a lecture on where to find it! -- 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 -~----------~----~----~----~------~----~------~--~---
first to answer the OP: a textarea element is an HTML element and there is no way to set the maximum length of a textarea (you can set max length on a text input element) other than using javascript tricks. note: max length is not the same as setting rows/columns. and second: and as far as people getting narky (never heard that word before), it''s most likely because, at least I have noticed, an ever increasing number of questions that really have nothing to do with Rails (like this one) or extremely simple questions that could be self-answered if the poster only took the time to search the documentation or web. This very same thing was (probably still is) an issue on the php lists, irc channels and forums as more and more new users began to use the language. i personally see nothing wrong with pointing people in the right direction as opposed to providing them with a free answer. a little push toward self-help goes a long way. call it tough love! On 3/20/07, ** ** <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Shiva Shiva wrote: > > how to set a maximum length for text area in rails > > > <label for="profile_comment">Comment:</label><br /> > <%= f.text_area :comment, :cols => 30, :rows => 5 %> > > When did forum members get so narky and unwilling to help? It would > have taken less characters to provide the answer than to give a lecture > on where to find it! > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Chris Hall wrote:> first to answer the OP: > > a textarea element is an HTML element and there is no way to set the > maximum length of a textarea (you can set max length on a text input > element) other than using javascript tricks. > > note: max length is not the same as setting rows/columns.I misunderstood the question it seems (unless the OP wants to clarify). However, I disagree that it has nothing to do with Rails. If the poster is using IRB then they may be using the text_area helper - is it not possible that after looking through the dreaded http://api.rubyonrails.org/ reference that the OP might think they have missed it, not knowing what it might be called in the API, regardless of whether it actually exists or not, or whether the equivalent function exists in HTML? Rails being such an incredible framework, it would not be unreasonable to expect that such a capability exists for this type of field. I find the API most unhelpful, but I''m the kind of person that learns faster from code examples. Searching my PDF references (I''ve bought most of the books) an trawling Google for answers is how I tend to find my answers - each to their own I guess. I agree however that the Agile Web Development with Rails [2nd Edition] is an excellent resource, along with Rails Recipes, Programming Ruby and SitePoint''s Ruby on Rails book. Tough love? I think more like self-righteous - "I had to find out the hard way so so do you - is closer to the truth". Sure there are people out there that abuse the kind heartedness of others, but what happened to benefit of the doubt. In my opinion, I think pointing someone at the resources is fine, but you may as well provide the answer in the same breath if you''re going to bother answering at all. -- 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 -~----------~----~----~----~------~----~------~--~---
Russell Norris
2007-Mar-20 16:03 UTC
Re: how to set a maximum length for text area in rails
About the time that shiva shiva posted four very, _VERY_ basic questions within an hour or so which seemed to indicate he [or she] needed something a little more comprehensive than a simple reply about how to solve _one_ question. I really did mean it helpfully. Heck, I ask a hell of a lot of questions sometimes. Moreso in the #rubyonrails channel but whatever. I know sometimes you really do need to RTFM. :/ RSL On 3/20/07, ** ** <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > When did forum members get so narky and unwilling to help? It would > have taken less characters to provide the answer than to give a lecture > on where to find it!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
As the saying goes "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." Tough love probably wasn''t the best description. Consider it more of a nudge in the right direction. On 3/20/07, ** ** <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Chris Hall wrote: > > first to answer the OP: > > > > a textarea element is an HTML element and there is no way to set the > > maximum length of a textarea (you can set max length on a text input > > element) other than using javascript tricks. > > > > note: max length is not the same as setting rows/columns. > > I misunderstood the question it seems (unless the OP wants to clarify). > > However, I disagree that it has nothing to do with Rails. If the poster > is using IRB then they may be using the text_area helper - is it not > possible that after looking through the dreaded > http://api.rubyonrails.org/ reference that the OP might think they have > missed it, not knowing what it might be called in the API, regardless of > whether it actually exists or not, or whether the equivalent function > exists in HTML? Rails being such an incredible framework, it would not > be unreasonable to expect that such a capability exists for this type of > field. I find the API most unhelpful, but I''m the kind of person that > learns faster from code examples. Searching my PDF references (I''ve > bought most of the books) an trawling Google for answers is how I tend > to find my answers - each to their own I guess. I agree however that > the Agile Web Development with Rails [2nd Edition] is an excellent > resource, along with Rails Recipes, Programming Ruby and SitePoint''s > Ruby on Rails book. > > Tough love? I think more like self-righteous - "I had to find out the > hard way so so do you - is closer to the truth". Sure there are people > out there that abuse the kind heartedness of others, but what happened > to benefit of the doubt. In my opinion, I think pointing someone at the > resources is fine, but you may as well provide the answer in the same > breath if you''re going to bother answering at all. > > -- > 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 -~----------~----~----~----~------~----~------~--~---