Module: Marty::ApplicationHelper
- Defined in:
- app/helpers/marty/application_helper.rb
Constant Summary collapse
- DEFAULT_ASSETS_PATH =
'app/assets'
Instance Method Summary collapse
- #asset_exists?(file, file_extension, default_path) ⇒ Boolean
- #javascript_exists?(file) ⇒ Boolean
- #stylesheet_exists?(file) ⇒ Boolean
Instance Method Details
#asset_exists?(file, file_extension, default_path) ⇒ Boolean
5 6 7 8 9 10 11 |
# File 'app/helpers/marty/application_helper.rb', line 5 def asset_exists?(file, file_extension, default_path) path = Rails.configuration.marty.send("assets_#{file_extension}_path") || default_path asset_path = Rails.root.join("#{path}/#{file}.#{file_extension}") File.exist?(asset_path) end |
#javascript_exists?(file) ⇒ Boolean
13 14 15 |
# File 'app/helpers/marty/application_helper.rb', line 13 def javascript_exists?(file) asset_exists?(file, :js, DEFAULT_ASSETS_PATH + '/javascripts') end |
#stylesheet_exists?(file) ⇒ Boolean
17 18 19 |
# File 'app/helpers/marty/application_helper.rb', line 17 def stylesheet_exists?(file) asset_exists?(file, :css, DEFAULT_ASSETS_PATH + '/stylesheets') end |