开发者

can i call model from other views in rails?

Say I have a model called Book. I have a controller named books and related views for this model. Is it possible开发者_高级运维 if I have another controller work with the model Book?

Thanks all. :)


It works inside any Controller, View or Model. To refer your model use upper cased class name. For example: Book


Yes. But, why would you want to do that? What is the usecase?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜