Fixed the admin-part of contact address

This commit is contained in:
Andres Keskküla 2014-09-25 16:44:44 +03:00
parent 31e92df6f6
commit 7ec06a4ade
8 changed files with 33 additions and 49 deletions

View file

@ -9,8 +9,7 @@ class Admin::ContactsController < ApplicationController
def new
@contact = Contact.new
@contact.build_local_address
@contact.build_international_address
@contact.build_address
end
def create
@ -56,8 +55,7 @@ class Admin::ContactsController < ApplicationController
end
def contact_params
params.require(:contact).permit( :email, :phone, :fax, :ident_type, :ident, :auth_info,
local_address_attributes: [:city, :street, :zip, :street2, :street3, :name, :org_name, :country_id],
international_address_attributes: [:city, :street, :zip, :street2, :street3, :name, :org_name, :country_id])
params.require(:contact).permit( :email, :phone, :fax, :ident_type, :ident, :auth_info, :name, :org_name,
address_attributes: [:city, :street, :zip, :street2, :street3, :country_id])
end
end