Can a Rails 3 engine access models from it's parent application?

那年仲夏 提交于 2019-12-03 12:30:17

问题


I have a Rails Engine and I want to access the parents models. Is that possible? If so, how would I do it?


回答1:


I didn't find any official documentation about it, but here's how you could still do it:

tests = ::Test.all

It'll return all tests from the parent app Test model.



来源:https://stackoverflow.com/questions/8855965/can-a-rails-3-engine-access-models-from-its-parent-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!