Thanks, but This is the way I already use.
It doesn-t works for the lines you type over the size (in columns) of the text area. In  this case, the text wrap on the next line but no mark "\n" came with it.
In this cases we will get the count of 1 line and inside the text area we will visualize 2 lines.
FF

Carl escribió:
You could count the number of lines like this:

lines = filed_name.split("\n").size

If I'm understanding what you are asking about.

Carl

On Jul 27, 12:54 pm, Fabian <[email protected]> wrote:
  
talking about text fields....
I have a text area of 30 columns in my html viewer of a text field
It works fine, for all CRUD operations. The only detail is about te text don,t include any controls ("\n" or "\l\n") for the lines was auto-breaked into the text area of the form.
I want to count the number of lines of this text area, but my code fails because I am counting "\n" marks.
I know this looks like an "HTML" issue (not Rails) but all suggestions will be appreciated.
Thanks in advance
FF
Robert Walker escribió:Frederick Cheung wrote:On Jul 27, 1:46 pm, Ritvvij<[email protected]>wrote:yes... text area to write the article and then save the whole article in DBYou didn't quite understand me. The column type you want (at least in mysql, sqlite3, postgresql etc) is called text FredAlso, as I understand it the migration t.text (or t.column :text) will map to an appropriate column type for the database being used (i.e. for Oracle the column would be clob).
    


  


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to