Conclusion

本章打造了 APP 的 layout 以及設定具名路由,接下來會繼續實作使用者註冊、登入、登出、建立使用者的微型部落格(microposts),最後可以讓使用者 follow 其他人的部落格。

先來 commit 和合併一下:

$ rake test
$ git add -A
$ git commit -m "Finish layout and routes"
$ git checkout master
$ git merge filling-in-layout

然後 push 到 Bitbucket:

$ git push

最後 deploy 到 Heroku:

$ rake test
$ git push heroku

學到什麼?

  • 使用 partial 拆分部份結構,放到單獨的目錄底下
  • Bootstrap 的套用
  • Asset Pipeline 可以打包靜態檔案,提高在 production 環境的使用效率
  • 在 Rails 可以自訂路由規則,得到具名路由
  • 整合測試能模擬瀏覽器中的點擊操作