I’ve got the following code I want to extract from a view, as I feel it’s violating Tell Don’t Ask (as it’s asking
@manager a question and then using
- if @manager.can_create_tags? = render("question_tags/management_links", question: @manager.question, tag: tag)
@manager is an instance of a service object PORO that I’ve extracted. I could just try including
ActionView::Helpers if that’s a way forward, but was wondering if anyone had solved this problem before. I know Draper jumps through a lot of hoops to get access to helpers, passing through the context from the Controller. I guess I could just extend my class from
Draper::Decorator, but that also feels a bit hacky too.
Any thoughts would be welcome, thanks!