Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save victorbstan/787065 to your computer and use it in GitHub Desktop.

Select an option

Save victorbstan/787065 to your computer and use it in GitHub Desktop.
Comprehensive list of acceptable values the Rails 3 generator rakes when defining ActiveRecord value types.
#################################
Scaffold generator options:
Format: [name, type]
#################################
# Active Record supports the following types:
:primary_key
:string
:text
:integer
:float
:decimal
:datetime
:timestamp
:time
:date
:binary
:boolean
# Options
[name:string], :null => false
#################################
Migration file options:
Format: [name, type, options]
#################################
:name, :datetime
:name, :string
:name, :decimal, :scale=>2, :default=>0, :precision=>8
[name, type, option 1, option 2, option 3]
#################################
View form options:
Format: [type, name, options]
#################################
file_field :name, :title => "Upload new Image"
text_area :name, :rows => 5, :size => "20x40", :value => "Hi, nice site"
check_box
email_field
fields_for
form_for
hidden_field
label
number_field
password_field
radio_button
range_field
search_field
telephone_field
text_field
url_field
####
If I have left anything out, or made errors email me: victor.stan@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment