A Rails app for task management
- Ruby:
2.6.0
- Rails:
5.2.3
-
users
Column Data Type id integer email string password string role string -
tasks
Column Data Type id integer user_id integer title string start_time datetime end_time datetime priority integer status integer description text -
tags
Column Data Type id integer name string title string -
tags_tasks (join table for "tags" and "tasks")
Column Data Type id integer tag_id integer task_id integer
$ rails db:create
建立資料庫$ rails db
確認有正確連接資料庫$ rails db:migrate
遷移資料庫描述檔$ rails db:seed
建立第一個管理員使用者(預設帳號密碼為email@email.com
和111111
)- 開啟伺服器
$ rails server -e production
(for production)$ rails server
(for development)
- 於瀏覽器網址列中輸入
localhost:3000
$ bundle exec guard
- Create a Heroku account
- Download & install the Heroku CLI
Mac OS users can download/install Heroku CLI via Homebrew from Terminal:
$ brew tap heroku/brew && brew install heroku
- Under the app's directory, run
$ heroku create
to create a Heroku app $ git remote -v
to confirm that a remote named heroku has been set for the app$ git push heroku master
to push the code onto Heroku from master branch$ heroku run bundle
$ heroku db:create
$ heroku rails db:migrate
- (optional) Renaming the app:
$ heroku apps:rename new_name --app old_name