module ZipSearch::SimpleFormHelper

Constants

METHODS_TO_EXPORT

Public Class Methods

simple_fields_for_current_location(fb, title=:current_location, *args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 13
def self.simple_fields_for_current_location(fb, title=:current_location, *args, &block)
  wrap_zs_fields fb.simple_fields_for(title, *args, &block)
end
simple_fields_for_location(fb, title=:location, *args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 7
def self.simple_fields_for_location(fb, title=:location, *args, &block)
  wrap_zs_fields fb.simple_fields_for(title, *args, &block)
end
simple_fields_for_location_history(fb, title=:location_history, *args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 16
def self.simple_fields_for_location_history(fb, title=:location_history, *args, &block)
  wrap_zs_fields fb.simple_fields_for(title, *args, &block)
end
simple_fields_for_locations(fb, title=:locations, *args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 10
def self.simple_fields_for_locations(fb, title=:locations, *args, &block)
  wrap_zs_fields fb.simple_fields_for(title, *args, &block)
end
wrap_zs_fields(fields_content) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 45
def self.wrap_zs_fields(fields_content)
  "<div class='zs-location-fields'>#{fields_content}</div>".html_safe
end

Public Instance Methods

simple_fields_for_current_location(*args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 32
def simple_fields_for_current_location(*args, &block)
  new_block = block_given? ? block : ->(fb2) {
    render partial: 'zip_search/simple_fields',
           locals: { title: :current_location, f: fb2 } }
  SimpleFormHelper.simple_fields_for_current_location(*args, &new_block)
end
simple_fields_for_location(*args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 20
def simple_fields_for_location(*args, &block)
  new_block = block_given? ? block : ->(fb2) {
    render partial: 'zip_search/simple_fields',
           locals: { title: :location, f: fb2 } }
  SimpleFormHelper.simple_fields_for_location(*args, &new_block)
end
simple_fields_for_location_history(*args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 38
def simple_fields_for_location_history(*args, &block)
  new_block = block_given? ? block : ->(fb2) {
    render partial: 'zip_search/simple_fields',
           locals: { title: :location, f: fb2 } }
  SimpleFormHelper.simple_fields_for_location_history(*args, &new_block)
end
simple_fields_for_locations(*args, &block) click to toggle source
# File lib/zip_search/simple_form_helper.rb, line 26
def simple_fields_for_locations(*args, &block)
  new_block = block_given? ? block : ->(fb2) {
    render partial: 'zip_search/simple_fields',
           locals: { title: :locations, f: fb2 } }
  SimpleFormHelper.simple_fields_for_locations(*args, &new_block)
end