Class: Polemic::StandardRenderer
- Inherits:
-
Object
- Object
- Polemic::StandardRenderer
- Includes:
- ActionView::Context
- Defined in:
- lib/polemic/standart_renderer.rb
Instance Method Summary collapse
-
#initialize(template) ⇒ StandardRenderer
constructor
include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper unless self.included_modules.include?(ActionView::Helpers::TagHelper).
-
#render_comments(commentable, options = {}) ⇒ Object
TODO implement logging see github.com/amatsuda/kaminari/blob/master/lib/kaminari/helpers/paginator.rb#L76.
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
TODO implement logging see github.com/amatsuda/kaminari/blob/master/lib/kaminari/helpers/paginator.rb#L76
18 19 20 21 |
# File 'lib/polemic/standart_renderer.rb', line 18 def render_comments(commentable, = {}) theme = .delete(:theme) || "default" @template.render(:partial => "polemic/#{theme}/comments", :locals => { :comments => commentable.comments.includes(:user), :commentable => commentable }) end |