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 <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jul 27, 1:28 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
On Jul 27, 1:46 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 Fred> not sure which datatype to use > 1. varchar 2000 / 4000 ... > 2. clob blob > > On Jul 27, 12:41 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > On Jul 27, 1:28 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
woops :D... ok let me check. Thanks a lot boss! On Jul 27, 12:55 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jul 27, 1:46 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > > not sure which datatype to use > > 1. varchar 2000 / 4000 ... > > 2. clob blob > > > On Jul 27, 12:41 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On Jul 27, 1:28 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
Frederick Cheung wrote:> On Jul 27, 1:46�pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > 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). -- Posted via http://www.ruby-forum.com/.
text works! :-) yupiieee... thanks a lot! On Jul 27, 1:12 pm, Robert Walker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Frederick Cheung wrote: > > On Jul 27, 1:46 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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). > -- > Posted viahttp://www.ruby-forum.com/.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> talking about text fields....<br> I have a text area of 30 columns in my html viewer of a text field<br> 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.<br> I want to count the number of lines of this text area, but my code fails because I am counting "\n" marks.<br> I know this looks like an "HTML" issue (not Rails) but all suggestions will be appreciated.<br> Thanks in advance<br> FF<br> <br> Robert Walker escribió: <blockquote cite="mid:f0611afd9ea22f1206d845bc494bddbc-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org" type="cite"> <pre wrap="">Frederick Cheung wrote: </pre> <blockquote type="cite"> <pre wrap="">On Jul 27, 1:46�pm, Ritvvij <a class="moz-txt-link-rfc2396E" href="mailto:ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"><ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">yes... text area to write the article and then save the whole article in DB </pre> </blockquote> <pre wrap="">You didn''t quite understand me. The column type you want (at least in mysql, sqlite3, postgresql etc) is called text Fred </pre> </blockquote> <pre wrap=""><!----> 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). </pre> </blockquote> <br> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. <br> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en<br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>
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 <fabia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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<ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>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).
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Thanks, but This is the way I already use.<br> 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.<br> In this cases we will get the count of 1 line and inside the text area we will visualize 2 lines.<br> FF<br> <br> Carl escribió: <blockquote cite="mid:db30a3eb-0578-43f1-b27f-99b4dacc9632-8o52BVNa5qsdsNuUwX5NYFYGCWtFR9XvxddQ6fo/n9Y@public.gmane.orgom" type="cite"> <pre wrap="">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 <a class="moz-txt-link-rfc2396E" href="mailto:fabia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"><fabia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">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<a class="moz-txt-link-rfc2396E" href="mailto:ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"><ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org></a>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). </pre> </blockquote> <pre wrap=""><!----> </pre> </blockquote> <br> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. <br> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en<br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>