Module: Blogit::PostsHelper
- Defined in:
- app/helpers/blogit/posts_helper.rb
Instance Method Summary (collapse)
-
- (Object) blog_post_tag(name, content_or_options = {}, options = {}, &block)
Creates a div tag with class ‘blog_post_’ + name Eg: .
-
- (Object) format_content(content = nil, &block)
Format content using the default_parser_class.
Instance Method Details
- (Object) blog_post_tag(name, content_or_options = {}, options = {}, &block)
Creates a div tag with class ‘blog_post_’ + name Eg:
blog_post_tag(: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 blog_post_tag(name, = {}, ={}, &block) if block_given? content = capture(&block) = else content = end [:class] = "#{[:class]} blog_post_#{name}".strip content_tag(name, content, ) 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 |