Specifying a different model than the controller name suggests
I've got a controller called "ResourcesController", but its really managing the CRUD for two different models.
I don't actually have a model called Resource, so the controller is balking that it can't find it.
Is there a way I can inform the controller which model I'll be working with so it doesn't freak out?
The error that is posted is this:
NameError in ResourcesController#new
uninitialized constant Resource
Here is the controller at the moment:
clas开发者_StackOverflow社区s ResourcesController < ApplicationController
def new
end
end
精彩评论