Sha256: e72888d75881a6a6b3254a8148bf814cf52abb989caa860ee9a0f26e7606388a
Contents?: true
Size: 1.68 KB
Versions: 2
Compression:
Stored size: 1.68 KB
Contents
= f.simple_fields_for method, (f.object.send(method) || f.object.addresses.build(:category => method.to_s.gsub('_address', ''))), (EffectiveAddresses.simple_form_options || {}) do |fa| - uuid = fa.object_id - method = method.to_sym - if ((f.object.errors.include?(method) && !f.object.errors.include?(:addresses)) rescue false) - fa.object.errors.add(:address1, f.object.errors[method].first) - if use_full_name || fa.object.errors.include?(:full_name) = fa.input :full_name, :required => required, :label => 'Full name', :prompt => 'Full name' = fa.input :address1, :placeholder => 'Address', :label => 'Address 1', :required => required = fa.input :address2, :label => 'Address 2' = fa.input :city, :placeholder => 'City', :required => required = fa.input :country_code, :as => :select, :label => 'Country', :prompt => 'Choose country...', :collection => region_options_for_simple_form_select(), :input_html => {'data-effective-address-country' => uuid}, :required => required - if fa.object.try(:country_code).present? = fa.input :state_code, :as => :select, :label => 'Province / State', :prompt => 'Please choose a country first', :collection => region_options_for_simple_form_select(Carmen::Country.coded(fa.object.country_code).subregions), :input_html => {'data-effective-address-state' => uuid}, :required => required - else = fa.input :state_code, :as => :select, :label => 'Province / State', :disabled => true, :prompt => 'Please choose a country', :collection => [], :input_html => { 'data-effective-address-state' => uuid }, :required => required = fa.input :postal_code, :label => 'Postal / Zip code', :placeholder => 'Postal / Zip code', :required => required
Version data entries
2 entries across 2 versions & 1 rubygems