Skip to content

Instantly share code, notes, and snippets.

@rynmrtn
Created August 1, 2009 16:40
Show Gist options
  • Save rynmrtn/159732 to your computer and use it in GitHub Desktop.
Save rynmrtn/159732 to your computer and use it in GitHub Desktop.
Cheat sheet for Rails Development
###
# 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"
<%= h("Text that needs to be escaped") %>
<!-- Stylesheets -->
<%= stylesheet_link_tag "depot", :media => "all" %>
# 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