Module: Boss::ApplicationHelper

Defined in:
app/helpers/boss/application_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ac_helperObject



3
4
5
# File 'app/helpers/boss/application_helper.rb', line 3

def self.ac_helper
  @ac_helper ||= ActionController::Base.new
end

Instance Method Details



7
8
9
10
11
# File 'app/helpers/boss/application_helper.rb', line 7

def banner_viewer
  # ::ApplicationController.ac_helper.render_to_string(partial: "boss/banners/banner_viewer",
  #                                                    locals: {banners: Boss::Banner.all}).html_safe
  render partial: "boss/banners/banner_viewer", locals: {banners: Boss::Banner.all}
end

#include_i18n_calendar_javascriptObject



13
14
15
16
17
18
19
20
21
# File 'app/helpers/boss/application_helper.rb', line 13

def include_i18n_calendar_javascript
  content_for :head do
    javascript_include_tag case I18n.locale
      when :en then "#{::ActionController::Base.helpers.asset_path('datepicker-locales/jquery.ui.datepicker-en-GB.js')}"
      when :pt then "#{::ActionController::Base.helpers.asset_path('datepicker-locales/jquery.ui.datepicker-pt-BR.js')}"
      else raise ArgumentError, "Locale error"
    end
  end
end