forked from xdite/rails-101
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
125 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{::pagebreak :/} | ||
|
||
## Ch 3.1.0 devise 與 Rails 4 | ||
## Ch 3.0 devise 與 Rails 4 | ||
|
||
### 安裝 gem | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,20 @@ | ||
# 練習作業 4 - 實作 User 後台 | ||
# 練習作業 4 - 實作 Account 後台 | ||
|
||
## 作業目標 | ||
|
||
實作簡單的 user account 機制 | ||
實作簡單的 Account 後台機制 | ||
|
||
* user 可以至 account 找到自己曾經發表過的文章 | ||
* user 可以修改自己的基本資料 | ||
|
||
|
||
## 練習主題 | ||
### 本章練習主題 | ||
|
||
* namespace routing | ||
* strong parameters | ||
|
||
## 作業解答 | ||
|
||
TODO | ||
|
||
# 練習作業 5 - 為文章列表加入分頁機制 | ||
|
||
## 作業目標 | ||
|
||
* 文章列表要能夠分頁 | ||
* 每一頁 10 筆 | ||
* 每個 Group 要秀出現在有多少 post 數量 | ||
* 文章列表的排序要以發表時間以 DESC 排序。 | ||
|
||
## 練習主題 | ||
|
||
* 使用 [counter_cache](http://railscasts.com/episodes/23-counter-cache-column) 取代直接對資料庫的 count | ||
* 實作看板分頁(pagination)機制 | ||
* 了解 ORM 的基本用法 | ||
|
||
|
||
## 作業解答 | ||
|
||
TODO | ||
|
||
|
||
# 練習作業 6 - Refactor code | ||
|
||
|
||
## 作業目標 | ||
|
||
* 使用系統 helper / 自己撰寫的 helper 包裝 html | ||
* 使用 partial 整理 html | ||
* 使用 scope 整理 query | ||
|
||
|
||
## 練習主題 | ||
|
||
* 練習使用內建 helper | ||
* 練習拆 partial | ||
* 練習使用 scope 機制包裝不同 condition 的 SQL query | ||
|
||
|
||
|
||
|
||
## 作業解答 | ||
|
||
TODO | ||
|
||
# 練習作業 7 - 撰寫自動化 Rake 以及 db:seed | ||
|
||
|
||
## 作業目標 | ||
|
||
用 Rake 撰寫自動化步驟,生假資料。 | ||
|
||
寫一個 rake 可以達成以下步驟:「砍 db => 建 db => 跑 migration => 生種子資料」,另一個 rake 是生假文章與假留言。 | ||
|
||
## 練習主題 | ||
|
||
* 操作 rake -T | ||
* 撰寫一個 task 可以自動連續執行 rake db:drop ; rake db:create ; rake db:migrate ; rake db:seed | ||
* 撰寫一個 task 可以執行 rake dev:fake 生假資料 ( 自己寫 namespace : dev, 裡面放一個 task 叫做 fake,fake 資料用 Populator 生) # 請自行練習 | ||
|
||
|
||
## 參考資料 | ||
|
||
* [Ruby on Rails Rake Tutorial](http://jasonseifer.com/2010/04/06/rake-tutorial) | ||
* [What’s New in Edge Rails: Database Seeding](http://ryandaigle.com/articles/2009/5/13/what-s-new-in-edge-rails-database-seeding) | ||
|
||
## 作業解答 | ||
|
||
TODO | ||
|
||
|
||
# 練習作業 8 - 將 Groupme deploy 到租來的 VPS | ||
|
||
|
||
## 作業目標 | ||
|
||
在租來的 VPS 上面建置 Ruby on Rails production 環境,使用 Ruby Enterprise Edition 與 mod_rails。使用 [Capistrano](https://github.com/capistrano/capistrano/wiki) 佈署 application。 | ||
|
||
## 練習主題 | ||
|
||
* 學會如何自動部署專案 | ||
* 使用 capistrano 自動部署專案 | ||
* 操作 cap deploy:setup | ||
* 操作 cap deploy | ||
* 操作 cap deploy:rollback | ||
* 操作 cap deploy:restart | ||
|
||
|
||
## 參考資料 | ||
|
||
* [rails-nginx-passenger-ubuntu](https://github.com/jnstq/rails-nginx-passenger-ubuntu) | ||
* [AWDR4](http://pragprog.com/titles/rails4/agile-web-development-with-rails) deploy 章節 | ||
|
||
|
||
## 作業解答 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 練習作業 5 - 為文章列表加入分頁機制 | ||
|
||
## 作業目標 | ||
|
||
* 文章列表要能夠分頁 | ||
* 每一頁 10 筆 | ||
* 每個 Group 要秀出現在有多少 post 數量 | ||
* 文章列表的排序要以發表時間以 DESC 排序。 | ||
|
||
## 練習主題 | ||
|
||
* 使用 [counter_cache](http://railscasts.com/episodes/23-counter-cache-column) 取代直接對資料庫的 count | ||
* 實作看板分頁(pagination)機制 | ||
* 了解 ORM 的基本用法 | ||
|
||
|
||
## 作業解答 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 練習作業 6 - Refactor code | ||
|
||
|
||
## 作業目標 | ||
|
||
* 使用系統 helper / 自己撰寫的 helper 包裝 html | ||
* 使用 partial 整理 html | ||
* 使用 scope 整理 query | ||
|
||
|
||
## 練習主題 | ||
|
||
* 練習使用內建 helper | ||
* 練習拆 partial | ||
* 練習使用 scope 機制包裝不同 condition 的 SQL query | ||
|
||
|
||
|
||
|
||
## 作業解答 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 練習作業 7 - 撰寫自動化 Rake 以及 db:seed | ||
|
||
|
||
## 作業目標 | ||
|
||
用 Rake 撰寫自動化步驟,生假資料。 | ||
|
||
寫一個 rake 可以達成以下步驟:「砍 db => 建 db => 跑 migration => 生種子資料」,另一個 rake 是生假文章與假留言。 | ||
|
||
## 練習主題 | ||
|
||
* 操作 rake -T | ||
* 撰寫一個 task 可以自動連續執行 rake db:drop ; rake db:create ; rake db:migrate ; rake db:seed | ||
* 撰寫一個 task 可以執行 rake dev:fake 生假資料 ( 自己寫 namespace : dev, 裡面放一個 task 叫做 fake,fake 資料用 Populator 生) # 請自行練習 | ||
|
||
|
||
## 參考資料 | ||
|
||
* [Ruby on Rails Rake Tutorial](http://jasonseifer.com/2010/04/06/rake-tutorial) | ||
* [What’s New in Edge Rails: Database Seeding](http://ryandaigle.com/articles/2009/5/13/what-s-new-in-edge-rails-database-seeding) | ||
|
||
## 作業解答 | ||
|
||
TODO | ||
|
||
|
||
# 練習作業 8 - 將 Groupme deploy 到租來的 VPS | ||
|
||
|
||
## 作業目標 | ||
|
||
在租來的 VPS 上面建置 Ruby on Rails production 環境,使用 Ruby Enterprise Edition 與 mod_rails。使用 [Capistrano](https://github.com/capistrano/capistrano/wiki) 佈署 application。 | ||
|
||
## 練習主題 | ||
|
||
* 學會如何自動部署專案 | ||
* 使用 capistrano 自動部署專案 | ||
* 操作 cap deploy:setup | ||
* 操作 cap deploy | ||
* 操作 cap deploy:rollback | ||
* 操作 cap deploy:restart | ||
|
||
|
||
## 參考資料 | ||
|
||
* [rails-nginx-passenger-ubuntu](https://github.com/jnstq/rails-nginx-passenger-ubuntu) | ||
* [AWDR4](http://pragprog.com/titles/rails4/agile-web-development-with-rails) deploy 章節 | ||
|
||
|
||
## 作業解答 | ||
|
||
TODO |