Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 001_create_products.rb
- class CreateProducts < ActiveRecord::Migration
- def self.up
- create_table :products do |t|
- t.column :title, :string
- t.column :description, :text
- t.column :image_url, :string
- end
- end
- def self.down
- drop_table :products
- end
- end
- admin_controller.rb
- class AdminController < ApplicationController
- scaffold :product
- end
- database.yml
- development:
- adapter: mysql
- encoding: utf8
- database: depot_development
- username: root
- password: password
- test:
- adapter: mysql
- encoding: utf8
- database: depot_test
- username: root
- password: password
- production:
- adapter: mysql
- encoding: utf8
- database: depot_production
- username: root
- password: password
Add Comment
Please, Sign In to add comment