Module: RailsConnector::CmsAssetHelper
- Included in:
- DefaultCmsHelper
- Defined in:
- app/helpers/rails_connector/cms_asset_helper.rb
Overview
This module contains helpers that can be used to reference images and other assets stored in the CMS.
Instance Method Summary collapse
-
#cms_image_tag(*args) ⇒ String
Calculates an HTML image tag for an image stored in the CMS.
Instance Method Details
#cms_image_tag(target, tag_options = {}) ⇒ String #cms_image_tag(obj, linklist, tag_options = {}, editing_options = {}) ⇒ String
Note:
There are two different signatures of this method: the first one generates an HTML image tag with no inplace editing possible, the second one generated an HTML image tag for inplace editing.
Calculates an HTML image tag for an image stored in the CMS.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/helpers/rails_connector/cms_asset_helper.rb', line 43 def cms_image_tag(*args) if args.second.nil? || args.second.is_a?(Hash) # Backwards compatibility. target = args.first = args.second || {} .symbolize_keys! [:src] = cms_path(target) [:alt] ||= display_title(target) tag('img', ) else obj = args.first field_name = args.second = args.third || {} = args.fourth || {} cms_tag('img', obj, field_name, (obj, field_name, .symbolize_keys, .symbolize_keys)) end end |