Skip to main content

Common Ruby on Rails commands.

# Creating a Rails Application
rails new myAppNameHere
  
# Generating the Scaffold
rails generate scaffold Product title:string description:text image_url:string price:decimal
  
# Apply any unapplied migrations to our database
rake db:migrate
  
# How to configure database (i.e.: SQLite, MySQL)
  # See: http://guides.rubyonrails.org/getting_started.html#configuring-a-database

# Start rails web server (http://localhost:3000/)
rails server

# Creates a Controller with scaffolding for Store
rails generate controller store index

# Deletes a Controller with scaffolding for Store
rails generate controller store index

# routes.rb
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'
# root :to => 'store#index', :as => 'store'