3 ms·
They just wrapped the view_context with a method_missing proxy (another form of a Decorator) that the controller instance gives you. You can accomplish the same
by rubiquity 13y ago
They just wrapped the view_context with a method_missing proxy (another form of a Decorator) that the controller instance gives you. You can accomplish the same very easily using dependency injection in your controller action:
MassivelyUpVotedPostPresenter.new(@post, self.view_context)
Or just inject the whole controller instance and you have your router helpers too!
MassivelyUpVotedPostPresenter.new(@post, self)