Module: Blogit::LayoutHelper

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

Instance Method Summary collapse

Instance Method Details

#description(content = nil) ⇒ Object

Sets or returns the description for a page. Formats the content if it’s Markdown or HTML and strips out the HTML tags.

content - The content to include in the HTML meta description tag.

Returns a String



24
25
26
27
28
29
30
# File 'app/helpers/blogit/layout_helper.rb', line 24

def description(content=nil)
  if content
    content_for(:description, strip_tags(format_content(content)).html_safe)
  else
    content_for(:description)
  end
end

#title(content = nil) ⇒ Object

Sets or returns the title for a page

content - The content to include in the HTML title tag.

Returns a String



10
11
12
13
14
15
16
# File 'app/helpers/blogit/layout_helper.rb', line 10

def title(content=nil)
  if content
    content_for(:title, content)
  else
    content_for(:title)
  end
end