Edit country select in forms

This commit is contained in:
Martin Lensment 2015-02-02 11:51:22 +02:00
parent 7537bb3712
commit 195aa4a890
7 changed files with 147 additions and 104 deletions

View file

@ -55,7 +55,7 @@ class Address < ActiveRecord::Base
def addr_hash_from_params(addr)
return {} if addr.nil?
return {} unless addr[:addr].is_a?(Hash)
{ country_id: Country.find_by(iso: addr[:addr][:cc]).try(:id),
{ country_code: Country.find_by(iso: addr[:addr][:cc]).try(:id),
city: addr[:addr][:city],
street: pretty_street(addr[:addr][:street]), # [0],
# street2: addr[:addr][:street][1],