First of all, why Docker?

At some point, I'm tired of installing these different applications on my mac. I need c++, python, ruby, mysql, postgresql etc all for different purposes. And once a while you will need a new version of all the packages. Having Docker removes the issue of having to dig into the code and fix every dependency once a while. Moreover, when I really need to fix something, since everything is documented in Dockerfile, it's easier for me to debug.

(閱讀全文......)

Rails 中的 Hash 不是真的 Hash?

不知道你有沒有注意過,在 rails 中無意識用到的 Hash 可能跟正常在 ruby 中的 Hash 不太一樣。舉例而言在 controller 中常用的 params 你可以進行以下操作:

(閱讀全文......)

最近嘗試 webpacker + rails 的設定的時候在引入 bulma 這關就卡了超久,所以決定將我最後的設定分享出來。

(閱讀全文......)

前陣子開始研究 rails 原始碼時看到很多關於 debug 的技巧,便有感而發想寫些關於 rails debug 的紀錄。稍微介紹一下我平常在 debug 時常用的兩個 gem,pry 以及 byebug

(閱讀全文......)

基礎

Rails 中的 scope 讓我們可以輕鬆的簡化 query 的長度,將常用的 query 設定為 scope method。

(閱讀全文......)

這裡我要來說明如何將 google analytics tracking code 加入 rails 4 。

(閱讀全文......)

一直很想實作 tag 相關的功能,這項功能雖然在 blog 體系中相當常見但我一直覺得如果能更廣泛的應用,例如在 file management 上使用 tag system 會是一件想當棒的事情。

(閱讀全文......)