Sha256: 2903a08c7ef93c05d82e5cd52d55fb9cbe2d21a848d35fa6c1b22cb73fe91666

Contents?: true

Size: 809 Bytes

Versions: 56

Compression:

Stored size: 809 Bytes

Contents

# -*- encoding : utf-8 -*-
InlineForms::SPECIAL_COLUMN_TYPES[:geo_code_curacao]=:string

# geo_code_curacao
def geo_code_curacao_show(object, attribute)
  attribute_value = object.send(attribute).presentation rescue nil
  link_to_inline_edit object, attribute, attribute_value
end
def geo_code_curacao_edit(object, attribute)
  attribute_value = object.send(attribute).presentation rescue nil
  out = text_field_tag attribute, attribute_value
  out << '<script>
		$( "#geo_code_curacao" ).autocomplete({
			source: "/geo_code_curacao",
			minLength: 2,
			});
	</script>'.html_safe
end

def geo_code_curacao_update(object, attribute)
  # extract the geocode
  geo_code = params[attribute].scan(/\d\d\d\d\d\d/).to_s || nil
  object[attribute.to_sym] = GeoCodeCuracao.new(geo_code).valid? ? geo_code : nil
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
inline_forms-1.5.9 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.8 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.7 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.6 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.5 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.4 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.3 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.2 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.1 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.5.0 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.9 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.8 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.7 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.6 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.5 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.4 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.3 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.2 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.1 lib/app/helpers/form_elements/geo_code_curacao.rb
inline_forms-1.4.0 lib/app/helpers/form_elements/geo_code_curacao.rb