aboutsummaryrefslogtreecommitdiffstats
path: root/app/decorators
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2013-12-23 17:07:37 +0100
committerHarald Eilertsen <haraldei@anduin.net>2013-12-23 17:07:37 +0100
commit3fb85eff8510ef7d5505924805cabde0edcebef3 (patch)
treecaef55a987f44de3d900d18159b9e78964e4ca99 /app/decorators
parente6c75a021441316ff1a1e0c9f2e9d5b027412a32 (diff)
downloadhmnoweb-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.rb9
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