# 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