Module: Blogit::CommentsHelper

Defined in:
app/helpers/blogit/comments_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) blog_comment_tag(name, content_or_options = {}, options = {}, &block)

Creates a div tag with class ‘blog_comment_’ + name Eg:

  blog_comment_tag(:email, "") # => <div class="blog_comment_email"></div>


7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/blogit/comments_helper.rb', line 7

def blog_comment_tag(name, content_or_options = {}, options ={}, &block)
  if block_given?
    content = capture(&block)
    options = content_or_options
  else
    content = content_or_options
  end
  options[:class] = "#{options[:class]} blog_comment_#{name}".strip
  (name, content, options)
end