So I have this code in a migration file .... create_table :books do |t| t.column "Title", :string t.column "Price", :decimal t.timestamps end Are "Title" and :string just parameters being passed to the method t.column? If so, I understand that "Title" is a string parameter, what is :string? a type param? Thanks -c --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Title : name of the column string : type of the column. it maps to varchar/varchar2 Similarly for Price http://api.rubyonrails.com/classes/ActiveRecord/Migration.html -- Shiv N Gautam On Mon, Jan 19, 2009 at 8:35 AM, typemismatch <craigw9292-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > So I have this code in a migration file .... > > create_table :books do |t| > t.column "Title", :string > t.column "Price", :decimal > t.timestamps > end > > Are "Title" and :string just parameters being passed to the method > t.column? > > If so, I understand that "Title" is a string parameter, what > is :string? a type param? > > Thanks > -c > > > >-- E. B. White - "Genius is more often found in a cracked pot than in a whole one." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 19 Jan 2009, at 03:05, typemismatch wrote:> > So I have this code in a migration file .... > > create_table :books do |t| > t.column "Title", :string > t.column "Price", :decimal > t.timestamps > end > > Are "Title" and :string just parameters being passed to the method > t.column? > > If so, I understand that "Title" is a string parameter, what > is :string? a type param?:string is a symbol see http://www.randomhacks.net/articles/2007/01/20/13-ways-of-looking-at-a-ruby-symbol or http://blog.hasmanythrough.com/2008/4/19/symbols-are-not-pretty-strings Fred> > > Thanks > -c > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---