diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2013-12-23 17:07:37 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2013-12-23 17:07:37 +0100 |
commit | 3fb85eff8510ef7d5505924805cabde0edcebef3 (patch) | |
tree | caef55a987f44de3d900d18159b9e78964e4ca99 /app/decorators | |
parent | e6c75a021441316ff1a1e0c9f2e9d5b027412a32 (diff) | |
download | hmnoweb-3fb85eff8510ef7d5505924805cabde0edcebef3.tar.gz hmnoweb-3fb85eff8510ef7d5505924805cabde0edcebef3.tar.bz2 hmnoweb-3fb85eff8510ef7d5505924805cabde0edcebef3.zip |
Move markup from decorator to template.
Note to self, use model decorators to massage model data, but leave
the markup to the views where it belong.
Diffstat (limited to 'app/decorators')
-rw-r--r-- | app/decorators/models/sidebar_post_decorator.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/decorators/models/sidebar_post_decorator.rb b/app/decorators/models/sidebar_post_decorator.rb index c6f10d5..93353bb 100644 --- a/app/decorators/models/sidebar_post_decorator.rb +++ b/app/decorators/models/sidebar_post_decorator.rb @@ -1,18 +1,11 @@ require 'delegate' class SidebarPostDecorator < SimpleDelegator - include ActionView::Helpers::TagHelper - include ActionView::Helpers::TextHelper - def initialize(post) super(post) end - def title - content_tag(:h2, link_to(super, __getobj__.friendly_id)) - end - def body - content_tag(:div, sanitize(truncate(super, :length => 32, :separator => ' '))) + super.truncate(64) end end |