blob: c6f10d51f12fa20e45ac59f8fc4d0eae3702ff95 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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 => ' ')))
end
end
|