over 1 year ago

index 還沒有裝impressionist

show 還沒有裝impressionist

DoctorsController 加上 impressionist only: [:show, :index]

index page:

show page: (Doctor_controller show method 還沒裝上 impressionist:impressionist(@doctor))
螢幕快照 2017-05-29 上午11.41.39

Doctor_controller show method 裝上 impressionist:impressionist(@doctor)
螢幕快照 2017-05-29 上午11.43.53

index page加上<%= doctor.impressionist_count %> 人瀏覽
螢幕快照 2017-05-29 上午11.45.14

show page加上<%= @doctor.impressionist_count %> 人瀏覽
螢幕快照 2017-05-29 上午11.45.59

← [Rails] 計數快取 counter_cache 用法,包含範例 ( log 的變化 ) 大亂鬥的日常 RDBMS(MySQL) and Rails ORM →