internetee-registry/app/helpers/epp/contacts_helper.rb
Martin Lensment 48710b41f7 Fix all tests
2014-07-03 17:53:15 +03:00

21 lines
491 B
Ruby

module Epp::ContactsHelper
def create_contact
ph = params_hash['epp']['command']['create']['create']
@contact = Contact.new(
code: ph[:id],
name: ph[:postalInfo][:name],
phone: ph[:voice],
email: ph[:email]
)
@contact.addresses << Address.new(
country_id: Country.find_by(iso: ph[:postalInfo][:cc]),
street: ph[:postalInfo][:street],
zip: ph[:postalInfo][:pc]
)
@contact.save
render '/epp/contacts/create'
end
end