Class: RoomPlanPickerInput

Inherits:
TomSelectInput
  • Object
show all
Defined in:
app/inputs/room_plan_picker_input.rb

Overview

SimpleForm input wrapper: room plan picker.

Instance Method Summary collapse

Methods inherited from TomSelectInput

#input_html_classes

Instance Method Details

#collectionObject



10
11
12
# File 'app/inputs/room_plan_picker_input.rb', line 10

def collection
  RoomPlan.where(id: selected_value).map { |rp| [rp.selection_name, rp.id] }
end

#input(wrapper_options = nil) ⇒ Object



4
5
6
7
8
# File 'app/inputs/room_plan_picker_input.rb', line 4

def input(wrapper_options = nil)
  input_html_options[:data] ||= {}
  input_html_options[:data]['tom-select-suggest-url-value'] = '/room_plans/lookup'
  super
end