samedi 19 décembre 2015

what is the difference between data: and :data in ruby on rails

I am working with ruby on rails, before starting rails,I learn some ruby and I know about:symbols as these are unique through out our application

but while learning rails, i encountered a wired symbols symbol: when working with rails models as I have created the rails model as

def up
    create_table :users do |t|
        t.string "email", :limit =>50, :null =>false
        t.column "password", :string, :limit =>30, :null => false
        #data types,binary, boolean, data, decima, float, integer,  text, time
        #these are the differentdata types
        #we can also have options
        #:default
        #:precision for decimal
        t.timestamps null: false
    end
  end

and I was so confused between the :null and null: define in the above code, I know :null is symbol and what null: is ?

Aucun commentaire:

Enregistrer un commentaire