Ruby on Rails model inside namespace can't be found in controller

后端 未结 4 1888
旧时难觅i
旧时难觅i 2021-02-04 11:52

I\'m new to rails and can\'t figure out this issue...

I have a controller

Admin::Blog::EntriesController

defined in app/controllers/adm

4条回答
  •  灰色年华
    2021-02-04 12:29

    Try:

    @blog_entries = ::Blog::Entry.find(:all)
    

    It's currently looking for the wrong class. Using :: before Blog will force it to look from the top level.

提交回复
热议问题