Class: Polemic::StandardRenderer

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context
Defined in:
lib/polemic/standart_renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ StandardRenderer

include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper unless self.included_modules.include?(ActionView::Helpers::TagHelper)



12
13
14
# File 'lib/polemic/standart_renderer.rb', line 12

def initialize(template)
  @template = template
end

Instance Method Details

#render_comments(commentable, options = {}) ⇒ Object



18
19
20
21
# File 'lib/polemic/standart_renderer.rb', line 18

def render_comments(commentable, options = {})
  theme = options.delete(:theme) || "default"
  @template.render(:partial => "polemic/#{theme}/comments", :locals => { :comments => commentable.comments.includes(:user), :commentable => commentable })
end