Rails scaffold data types
Contact me at LinkedIn  RailsZilla at Facebook  RailsZilla at twitter   google +1  Contact me at Xing  connect me at github

Rails scaffold data types

Posted in Rails

If you work with a scaffold it can happen to anybody to forget the datatypes. Here is a cheat sheet for all the Rails 4 (ActiveRecord migration) datatypes at a glance:

1
2
3
4
5
6
7
8
9
10
11
12
13
    :binary
    :boolean
    :date
    :datetime
    :decimal
    :float
    :integer
    :primary_key
    :references
    :string
    :text
    :time
    :timestamp

These are also valid for Rails 3.
I love to work with PostgreSQL and if you love it too, you can also take advantage of these datatypes:

1
2
3
4
5
6
    :hstore
    :json
    :array
    :cidr_address
    :ip_address
    :mac_address

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter a secure code to see if you are a spammer ;-)

 

Copyright © 2011-2017  - RailsZilla – Ruby on Rails tutorials, tips and tricks All rights reserved. | Imprint | Privacy