Sha256: 022ced86a1be3221f19ceb0e71fd554ee46f859c7356242609258b71e0491d37

Contents?: true

Size: 764 Bytes

Versions: 25

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

# ApplicationHelper -> Helpers base
module ApplicationHelper
  # Title dinamic in all keppler
  def title(page_title)
    content_for(:title) { page_title }
  end

  # Meta Descriotion dinamic in all keppler
  def meta_description(page_description)
    content_for(:description) { page_description }
  end

  # True if a user is logged
  def loggedin?
    current_user
  end

  def can?(model)
    Pundit.policy(current_user, model)
  end

  def landing?
    controller_name.eql?('front') && action_name.eql?('index')
  end

  def model_object
    parent = controller.class.parent.to_s.underscore
    parent_sym = parent.remove('keppler_').split('/').first.to_sym
    parent.eql?('admin') ? [:admin] : [:admin, parent_sym]
  end
end

Version data entries

25 entries across 24 versions & 1 rubygems

Version Path
keppler-2.1.3 installer/core/app/helpers/application_helper.rb
keppler-2.1.2 installer/core/app/helpers/application_helper.rb
keppler-2.1.1 installer/core/app/helpers/application_helper.rb
keppler-2.1.pre.p1 installer/core/app/helpers/application_helper.rb
keppler-2.1 installer/core/app/helpers/application_helper.rb