Last active
June 26, 2016 16:11
-
-
Save nikolalsvk/4391d9ecd71a7a37208c88578b4d2c92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def receive_data | |
basic_info = params[:basicInfo] | |
contact_info = params[:contactInfo] | |
business_partner = BusinessPartner.new | |
contact_card = ContactCard.new | |
business_partner.contact_card = contact_card | |
business_partner.from_json(basic_info) | |
contact_card.from_json(contact_info) | |
ActiveRecord::Base.transaction do | |
contact_card.save! | |
business_partner.save! | |
end | |
render :text => "[Receipt-Yourself]: Added new business partner.", :status => 200 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment