Hello,
I have the following two models:
class Project < ActiveRecord::Base
has_many :photoalbums
end
class PhotoAlbum < ActiveRecord::Base
belongs_to :space
end
routes.rb:
resources :projects do
resources :photo_albums
end
What I'm trying to do in the Controller is get a list of all the project's photoalbums:
class PhotoAlbumsController < ApplicationController
def index
@project = Project.find(params[:project_id])
@photoalbums = @project.photoalbums.all
end
end
But I'm getting the following error?
uninitialized constant Project::Photoalbum