Module: EffectiveAddressesHelper

Defined in:
app/helpers/effective_addresses_helper.rb

Instance Method Summary collapse

Instance Method Details

#effective_address_fields(form, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/effective_addresses_helper.rb', line 4

def effective_address_fields(form, options = {})
  opts = {:f => form, :category => 'address', :skip_full_name => false}.merge(options)

  case opts[:category]
  when 'shipping'
    opts[:name] = 'Shipping Address'
    opts[:method] = :shipping_address
  when 'billing'
    opts[:name] = 'Billing Address'
    opts[:method] = :billing_address
  when 'primary'
    opts[:name] = 'Primary Address'
    opts[:method] = :primary_address
  when 'secondary'
    opts[:name] = 'Secondary Address'
    opts[:method] = :secondary_address
  else
    opts[:name] = 'Address'
    opts[:method] = :address
  end

  render :partial => 'effective/addresses/address_fields', :locals => opts
end