routes.rbでresourcesを使ったときのパラメータをid以外にする
Railsではhas_manyな関連を持つモデルに対してRESTなルートを簡単に定義できる。 1# routes.rb 2resources :blogs, only: [:index] 3 resources :posts, only: [:index] 4end このようなル …
Railsではhas_manyな関連を持つモデルに対してRESTなルートを簡単に定義できる。 1# routes.rb 2resources :blogs, only: [:index] 3 resources :posts, only: [:index] 4end このようなル …