Class: GoogleMapsAutocompleteInput

Inherits:
SimpleForm::Inputs::StringInput
  • Object
show all
Includes:
ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
Defined in:
app/inputs/google_maps_autocomplete_input.rb

Instance Method Summary collapse

Instance Method Details

#inputObject



4
5
6
7
8
9
10
11
# File 'app/inputs/google_maps_autocomplete_input.rb', line 4

def input
  gmap_id = input_html_options.delete(:gmap_id)
  apply = input_html_options.key?(:apply) ? input_html_options.delete(:apply) : true
  lat_id = input_html_options.key?(:lat_id) ? input_html_options.delete(:lat_id) : nil
  lng_id = input_html_options.key?(:lng_id) ? input_html_options.delete(:lng_id) : nil
  input = @builder.text_field(attribute_name, input_html_options)
  (input + javascript_tag(script_text(gmap_id, input, apply, lat_id, lng_id))).html_safe
end