Module: Enki::ApplicationHelper

Included in:
ApplicationController
Defined in:
app/helpers/enki/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#authorObject



4
5
6
# File 'app/helpers/enki/application_helper.rb', line 4

def author
  Struct.new(:name, :email).new(Enki.config[:author][:name], Enki.config[:author][:email])
end

#comments?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/helpers/enki/application_helper.rb', line 16

def comments?
  Enki.config.comments?
end

#format_comment_error(error) ⇒ Object



8
9
10
11
12
13
14
# File 'app/helpers/enki/application_helper.rb', line 8

def format_comment_error(error)
  {
    'body'   => 'Please comment',
    'author' => 'Please provide your name or OpenID identity URL',
    'base'   => error.last
  }[error.first.to_s]
end

#paginated(*args) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'app/helpers/enki/application_helper.rb', line 24

def paginated(*args)
  if defined? ::Kaminari
    paginate(*args)
  elsif defined? ::WillPagniate
    will_paginate(*args)
  else
    nil
  end
end

#tags?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/helpers/enki/application_helper.rb', line 20

def tags?
  Enki.config.tags?
end