Sure, I just don't like mixing concerns. To me a decorator is a composite,
or decorator object. That is not the same as a 'web enabled' object that
knows about html.


On Sun, Apr 20, 2014 at 11:27 AM, Justin Gordon <notifications@github.com>wrote:

> In app/decorators/micropost_decorator.rb:
>
> > @@ -5,4 +5,12 @@ def posted_ago
> >        "Posted #{h.time_ago_in_words(object.created_at)} ago."
> >      end
> >    end
> > +
> > +  def profanity_violation_msg
> > +    <<-MSG.html_safe
>
> I'm finding that putting the intersection of model-based presentation-code
> in Draper decorators works well for me. With you example, you need a way to
> include the view context bits. Not hard, but I find that Draper Decorators
> work fine in the "Rails" context.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/justin808/fat-code-refactoring-techniques/pull/15/files#r11798268>
> .
>



-- 


--
James
@thatrubylove

Advanced Ruby musings @ RubyLove.io
https://www.rubylove.io

Expert mentor @ Codementor.io
https://www.codementor.io/thatrubylove