Sha256: bc62d8f10817514c60a9edc8d10c289cbcb8af7675e9ca96067d144990402697

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

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

    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

    def comments?
      Enki.config.comments?
    end
    
    def tags?
      Enki.config.tags?
    end
    
    def paginated(*args)
      if defined? ::Kaminari
        paginate(*args)
      elsif defined? ::WillPagniate
        will_paginate(*args)
      else
        nil
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enki-engine-0.0.5 app/helpers/enki/application_helper.rb
enki-engine-0.0.4 app/helpers/enki/application_helper.rb
enki-engine-0.0.3 app/helpers/enki/application_helper.rb
enki-engine-0.0.2 app/helpers/enki/application_helper.rb