module ZipSearch::ViewHelpers
Public Instance Methods
location_search_field(options={})
click to toggle source
# File lib/zip_search/view_helpers.rb, line 7 def location_search_field(options={}) settings = { field: { placeholder: 'Filter by location...', class: '' }, form: { url: request.url, method: :get, html: { class: '', style: '' } } }.deep_merge(options) if params.key?(:location_search) && params[:location_search].key?(:q) settings[:field][:class] << ' zipsearch-typeahead' settings[:field][:value] ||= params[:location_search][:q] end settings[:form][:html][:class] << ' location-search-form pull-left' # form_style = "margin:10px 6px 0 0;#{settings[:form][:html][:style]}" # settings[:form][:html][:style] = form_style render 'zip_search/locations/search_field', settings: settings end