- I think you should use
__FILE__instead of__dir__ - If you’re calling it outside of a class body it should be
self.prepend_view_path
So I believe this will work
after_initialize do
class ::TopicsController
self.prepend_view_path File.expand_path("../app/views", __FILE__)
end
end