I'm quite new to RESTful Rails and tried a bit with a new app, but it
seems I don't comprehend something yet.
I have the following two models:
class CompactDisc < ActiveRecord::Base
class Genre < ActiveRecord::Base
In routes.rb I have the following route:
ActionController::Routing::Routes.draw do |map|
map.resources :genres do |genre|
genre.resources :compact_discs, :name_prefix => 'genre_'
When opening localhost:3000/compact_discs it shows me all CD's. When
opening localhost:3000/genres/1/compact_discs it still shows me all
CD's! Shouldn't it only display the ones that are associated to genre 1
now? Or did I miss something?
I also played with
map.resources :genres, :has_many => :compact_discs
but this didn't help me neither...
Thanks for help