したがって、私の Rails アプリには、ユーザーに属する 2 つのリソース (レンタルと予約) があります。これは、ネストされたルートを設定するための routes.rb のコードです。
map.resources :users, :has_many => :reservations, :shallow => true
map.resources :users, :has_many => :rentals, :shallow => true
map.resources :rentals, :only => [:index]
map.resources :reservations, :only => [:index]
これを行うためのより好ましい方法はありますか。グーグルで調べましたが、明確な答えが見つかりません。
前もって感謝します。
-光線