开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜