Class: RoomPlanPickerInput

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

Instance Method Summary collapse

Methods inherited from TomSelectInput

#input_html_classes

Instance Method Details

#collectionObject



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

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

#input(wrapper_options = nil) ⇒ Object



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

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