This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
custom.txt
61 lines (51 loc) · 1.66 KB
/
custom.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
rbenv local 1.9.2-p290
rails new sotm
cd sotm
cat >> Gemfile << EOT
gem 'twitter-bootstrap-rails'
EOT
bundle install
rails generate bootstrap:install
yes "y"|rails generate bootstrap:layout application fluid
rails generate controller pages index
rake db:create
rails generate scaffold Auction title:string description:text image_url_main:string image_url_sub:string winner:string start_at:datetime auction_uniq_id:string
rails generate scaffold Bidding name:string price:integer auction_uniq_id:string
rake db:migrate
# rails generate scaffold Auction title:string description:text image_url_main:string image_url_sub:string winner:string start_at:datetime
# rails generate scaffold Bidding name:string price:integer
# rails generate migration AddAuctionIdToBiddings
# cat > `ls -tr db/migrate/*_add_auction_id_to_biddings.rb |tail -1` <<EOT
# class AddAuctionIdToBiddings < ActiveRecord::Migration
# def self.up
# add_column(:biddings, :auction_id, :integer)
# add_index(:biddings, :auction_id)
# end
#
# def self.down
# remove_index(:biddings, :column => :auction_id)
# remove_column(:biddings, :auction_id)
# end
# end
# EOT
# rake db:migrate
#
# cat >app/models/auction.rb <<EOT
# class Auction < ActiveRecord::Base
# has_many :biddings
# end
# EOT
#
# cat >app/models/bidding.rb <<EOT
# class Bidding < ActiveRecord::Base
# belongs_to :auction
# end
# EOT
sudo apt-get install mysql-server mysql-client libmysqlclient-dev libsqlite3-dev
vi Gemfile
bundle.....
vi config/database.yml
vi config/environments/production.rb
bundle exec rake db:migrate
bundle exec rake assets:precompile RAILS_ENV=production
RAILS_ENV=production ruby script/rails server -p80