Sha256: f1c6f2ca190efa06ec4500d8fca7fa827c592765e72bf862d57823fa34bd972d

Contents?: true

Size: 686 Bytes

Versions: 32

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

module NfgUi
  # Core rendering helper methods
  module ApplicationHelper
    # render components from the pertinent suite
    # Network for Good components: = ui.nfg
    # Bootstrap core components:   = ui.bootstrap
    include FontAwesome::Rails::IconHelper

    def ui
      @ui ||= NfgUi::UI::Base.new(get_view_context)
    end

    private

    # presenter class controller may not be defined
    def get_view_context
      if defined?(controller) && controller.present?
        controller.view_context
      else
        ApplicationController.new.view_context
      end
      # @ui ||= NfgUi::UI::Base.new(controller.view_context)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
nfg_ui-0.9.28 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.27 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.26 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.25.1 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.25 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.24.3 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.24.2 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.24.1 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.24 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.23 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.22 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.21 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.20 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.19.1 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.19 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.18.3 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.18.2 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.18.1 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.18 app/helpers/nfg_ui/application_helper.rb
nfg_ui-0.9.17 app/helpers/nfg_ui/application_helper.rb