Module: Cul::Hydra::Controller
- Defined in:
- app/controllers/concerns/cul/hydra/controller.rb
Instance Method Summary collapse
Instance Method Details
#asset_path_from_config(asset) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/controllers/concerns/cul/hydra/controller.rb', line 3 def asset_path_from_config(asset) Rails.configuration.assets.paths.each do |dir| result = "#{dir}/#{asset}" return result if File.exists?(result) end return nil end |
#asset_url(source) ⇒ Object
11 12 13 |
# File 'app/controllers/concerns/cul/hydra/controller.rb', line 11 def asset_url(source) URI.join(root_url, ActionController::Base.helpers.asset_path(source)) end |
#http_client ⇒ Object
15 16 17 18 19 20 |
# File 'app/controllers/concerns/cul/hydra/controller.rb', line 15 def http_client unless @http_client @http_client ||= HTTPClient.new end @http_client end |