Module: Blogo::ApplicationHelper

Defined in:
app/helpers/blogo/application_helper.rb

Overview

Note, _path postfix is avoided to not mess helper methods and routes.

Instance Method Summary collapse

Instance Method Details

#path_to_page(page, tag = nil) ⇒ Object

Path to a page or a page in scope of a particular tag.

Parameters:

  • page (Integer)
  • tag (String, nil) (defaults to: nil)

12
13
14
15
16
17
18
# File 'app/helpers/blogo/application_helper.rb', line 12

def path_to_page(page, tag = nil)
  if tag
    blogo_tag_page_path(tag, page)
  else
    blogo_page_path(page)
  end
end

#post_overview(post) ⇒ String

Post overview.

Parameters:

Returns:

  • (String)

25
26
27
# File 'app/helpers/blogo/application_helper.rb', line 25

def post_overview(post)
  post.html_overview ? post.html_overview : post.html_content
end