Created
August 1, 2009 16:40
-
-
Save rynmrtn/159732 to your computer and use it in GitHub Desktop.
Cheat sheet for Rails Development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Migrations | |
# data_types = {:string, :text, :integer, :float, :decimal, :datetime, :timestamp, | |
# :time, :date, :binary, :boolean } | |
# Add a Column | |
add_column :table_name, :column_name, :data_type, :options | |
# Remove a Column | |
remove_column :table_name, :column_name | |
### | |
# Logging | |
# | |
logger.debug "string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= h("Text that needs to be escaped") %> | |
<!-- Stylesheets --> | |
<%= stylesheet_link_tag "depot", :media => "all" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Migration | |
$ ruby script/generate migration name_of_migration | |
$ ruby script/generate migration name_of_migration column_name:type column2_name:type2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment