Open olivierobert opened 7 years ago
A lot of erb-based views + controllers / would benefit of using presenter classes to abstract the complexity of rendering content.
Instead of:
result: @result[:url] || ResultNullObject.new
It could be (abbreviated example):
result: @result_presenter.url
class ResultPresenter ... def url @result[:url] || ResultNullObject.new end end
Indeed, should have used presenter; but thought it would be an overkill for such a small project. :)
A lot of erb-based views + controllers / would benefit of using presenter classes to abstract the complexity of rendering content.
Instead of:
It could be (abbreviated example):