Sha256: 2e97197340f37fcd7f4851650b3529a5e7de37090475db9049eef252e1ebdb5f

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

require 'carmen-rails'

module EffectiveAddressesHelper
  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
effective_addresses-0.1 app/helpers/effective_addresses_helper.rb