Sha256: 738a0f22882e5e55786e6ba196814b2d186a656ff7ee6cbbca0808df6a03bbc2
Contents?: true
Size: 864 Bytes
Versions: 5
Compression:
Stored size: 864 Bytes
Contents
module Editmode module Helper # Render non-editable content def e(identifier, *args) field, options = parse_arguments(args) begin chunk = Editmode::ChunkValue.new(identifier, options) if chunk.chunk_type == 'collection_item' chunk.field(field) else chunk.content end rescue => er raise er end end def render_custom_field_raw(label, options={}) e(@custom_field_chunk["identifier"], label, options) end alias_method :f, :render_custom_field_raw def parse_arguments(args) field = nil options = {} if args[0].class.name == 'String' field = args[0] options = args[1] || {} elsif args[0].class.name == 'Hash' options = args[0] || {} end return field, options end end end
Version data entries
5 entries across 5 versions & 1 rubygems