Class: RoomConfigurationPickerInput
- Inherits:
-
TomSelectInput
- Object
- SimpleForm::Inputs::CollectionSelectInput
- TomSelectInput
- RoomConfigurationPickerInput
- Defined in:
- app/inputs/room_configuration_picker_input.rb
Instance Method Summary collapse
Methods inherited from TomSelectInput
Instance Method Details
#collection ⇒ Object
12 13 14 15 |
# File 'app/inputs/room_configuration_picker_input.rb', line 12 def collection # Ensure the current value renders as the selected option to avoid blank display RoomConfiguration.where(id: selected_value).map { |rc| [rc.reference_number, rc.id] } end |
#input(wrapper_options = nil) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/inputs/room_configuration_picker_input.rb', line 3 def input( = nil) [:data] ||= {} default_url = '/room_configurations/lookup' [:data]['tom-select-suggest-url-value'] ||= default_url # Allow override via options[:suggest_url] [:data]['tom-select-suggest-url-value'] = [:suggest_url] if [:suggest_url].present? super end |