Module: Blogit::PostsHelper

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

Instance Method Summary (collapse)

Instance Method Details

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

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

  (:title, "") # => <div class="blog_post_title"></div>


14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/blogit/posts_helper.rb', line 14

def (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_post_#{name}".strip
  (name, content, options)
end

- (Object) format_content(content = nil, &block)

Format content using the default_parser_class



5
6
7
8
9
# File 'app/helpers/blogit/posts_helper.rb', line 5

def format_content(content = nil, &block)
  content = capture(&block) if block_given?
  parser = Blogit::configuration.default_parser_class.new(content)
  parser.parsed.html_safe
end