Sha256: 6bc5f8a1a415a3cca29c39d926069977b39c3a3e23793b6d17ecef3f86522e21
Contents?: true
Size: 806 Bytes
Versions: 35
Compression:
Stored size: 806 Bytes
Contents
/ Example: / = wcms_component "forms/tag_input", / form: f, / attribute: :courses_string, / typeahead: { url: courses_path(format: :json), key: 'course_key'} / ruby: form ||= nil attribute ||= nil value ||= value separator ||= ',' html_class ||= 'form-control' typeahead ||= nil # for available options see tag_input.js.coffee options ||= {} html_options = options.merge({ class: html_class, data: {role: 'tagsinput', typeahead: typeahead} }) if form && attribute && form.object.respond_to?(attribute) value ||= form.object[attribute] end value = value.join(separator) if value.is_a?(Array) html_options[:value] = value unless value.nil? - if form = form.text_field attribute, html_options - else = text_field_tag attribute, value, html_options
Version data entries
35 entries across 35 versions & 1 rubygems