ravelll の日記

よしなに

Rails

Nested Resources 時に親モデルのルーティングはしたくない

どういうことかと言うと、 User has_many Products のような 2つのモデルがある POST /users/:user_id/products のルーティングがしたい けど、/users/ についてのルーティングはしたくない のような状況。より具体的には以下の感じです。 resources :users,…

Prevent N+1 Query Problems in index action on Active Admin.

Active Admin is a Ruby on Rails plugin that provides administration web page. Our development team uses it for our service. Few days ago, we bring in bullet gem, then we found N+1 query problems in some administration index pages. I search…