Varchar size for a blog post

Hi,

I know this ones a dumb question. I wanna create a blog and store the
article in DB. it can be HUGE text.

Can someone please mention the data type in rails and its equivalent
in my sql is generally used?

On Jul 27, 1:28 pm, Ritvvij [email protected] wrote:

Hi,

I know this ones a dumb question. I wanna create a blog and store the
article in DB. it can be HUGE text.

Can someone please mention the data type in rails and its equivalent
in my sql is generally used?

You want a text column

Fred

yes… text area to write the article and then save the whole article
in DB
not sure which datatype to use

  1. varchar 2000 / 4000 …
  2. clob blob

On Jul 27, 12:41 pm, Frederick C. [email protected]

On Jul 27, 1:46 pm, Ritvvij [email protected] wrote:

yes… text area to write the article and then save the whole article
in DB

You didn’t quite understand me. The column type you want (at least in
mysql, sqlite3, postgresql etc) is called text

Fred

Frederick C. 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 DB

You didn’t quite understand me. The column type you want (at least in
mysql, sqlite3, postgresql etc) is called text

Fred

Also, 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).

woops :D… ok let me check. Thanks a lot boss!

On Jul 27, 12:55 pm, Frederick C. [email protected]

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 W. escribió:
Frederick C. 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 DB
      
You didn't quite understand me. The column type you 
want (at least in
mysql, sqlite3, postgresql etc) is called text

Fred

Also, 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
-~----------~----~----~----~------~----~------~--~---

text works! :slight_smile: yupiieee… thanks a lot!

On Jul 27, 1:12 pm, Robert W. [email protected]

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

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 W. escribió:Frederick C. 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
-~----------~----~----~----~------~----~------~--~---