Sha256: 6da141da47ce7793ca24911d0392230f9c6de028f1b0d500aef8dc69a8b60d3b

Contents?: true

Size: 1.66 KB

Versions: 21

Compression:

Stored size: 1.66 KB

Contents

- parsed_json = field.options.is_a?(Hash) ? field.options : (JSON.parse(field.options) unless field.options == '')
- if parsed_json&.dig('collection', 'name')
  - if value.present?
    = f.input field.title.to_sym, as: :select, collection: collection_list_by(name: parsed_json['collection']['name']), input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, selected: value, required: field.required
  - else
    = f.input field.title.to_sym, as: :select, collection: collection_list_by(name: parsed_json['collection']['name']), input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, required: field.required
- elsif parsed_json&.dig('collection', 'array')
  - if value.present?
    = f.input field.title.to_sym, as: :select, collection: parsed_json.dig('collection', 'array'), input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, selected: value, required: field.required
  - else
    = f.input field.title.to_sym, as: :select, collection: parsed_json.dig('collection', 'array'), input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, required: field.required
- else
  - if value.present?
    = f.input field.title.to_sym, as: :select, input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, selected: value, required: field.required
  - else
    = f.input field.title.to_sym, as: :select, input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, required: field.required

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
tramway-core-1.17.6 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.5 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.4.2 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.4.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.4 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.3.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.3 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2.5 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2.4 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2.3 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2.2 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.2 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.1.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.17 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.16.2.1 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.16.2 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.16.1.9 app/views/tramway/core/shared/input_extended_types/_select.html.haml
tramway-core-1.16.1.8 app/views/tramway/core/shared/input_extended_types/_select.html.haml