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

Version Path
biola_wcms_components-0.25.4 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.25.3 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.25.2 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.25.1 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.25.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.24.3 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.24.2 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.24.1 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.24.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.23.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.22.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.21.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.20.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.19.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.18.1 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.18.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.17.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.16.0 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.15.3 app/views/wcms_components/forms/_tag_input.html.slim
biola_wcms_components-0.15.2 app/views/wcms_components/forms/_tag_input.html.slim