This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Developing a Quick Reference [Nov. 30, 2011, 8:18 a.m.]


Collablorative work editing, modifying and adding to the beginners quick reference guide:

RAILS QUICK Reference

Note: colon NOT part of command statement.

rails new <name of directory> : Creates the project directory.
rake db:create : Creates the database using the default SQLite.

rake -t :  Shows the commands.
rails s : Start the rails server.
ctrl C :   Stops the rails server.
http://localhost:3000 :  Default webpage indicates that it is working.

rails generate controller home index : Rails generated the home controller and View in the app directory which is where you mainly will be working in.

By typing "rails" and "rails generate" in the command line, a list of commands are displayed:

Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 application  Generate the Rails application code
 destroy      Undo code generated with "generate"
 benchmarker  See how fast a piece of code runs
 profiler     Get profile information from a piece of code
 plugin       Install a plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h for more information.
Usage: rails generate GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

Please choose a generator below.

Rails:
  assets
  controller
  generator
  helper
  integration_test
  mailer
  migration
  model
  observer
  performance_test
  plugin
  resource
  scaffold
  scaffold_controller
  session_migration

Coffee:
  coffee:assets

Jquery:
  jquery:install

Js:
  js:assets