Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#app_nameObject



17
18
19
# File 'app/helpers/application_helper.rb', line 17

def app_name
  application_name
end

#application_nameObject



13
14
15
# File 'app/helpers/application_helper.rb', line 13

def application_name 
  AppVersion.app_name
end

#asset_url(asset) ⇒ Object



21
22
23
# File 'app/helpers/application_helper.rb', line 21

def asset_url(asset)
  "#{request.protocol}#{request.host_with_port}#{asset_path(asset)}"
end

#present(object, klass = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/application_helper.rb', line 3

def present(object, klass = nil)
  klass ||= "#{object.class}Presenter".constantize
  presenter = klass.new(object, self)
  if block_given?
    yield presenter 
  else
    presenter.present()
  end
end