Module: AddressesHelper

Defined in:
app/helpers/addresses_helper.rb

Instance Method Summary collapse

Instance Method Details

#address_form(address, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/addresses_helper.rb', line 2

def address_form(address, options = {})
  render partial: 'simple_address/addresses/form',
    locals: {
      address: address,
      path:  address_path(address, options),
      countries: SimpleAddress::Country.all.map { |c| [c.name, c.id] },
      form_class: options[:form_class] || 'simple_address_form',
      label_class: options[:label_class] || 'simple_address_label',
      field_class: options[:field_class] || 'simple_address_field',
      data: options[:data] || {}
    }
end