Created
April 24, 2013 14:54
-
-
Save mangantj/5452758 to your computer and use it in GitHub Desktop.
This file contains 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 new | |
@contact = Contact.new | |
@address = Address.new | |
@e_mail_address = EMailAddress.new | |
@phone_number = PhoneNumber.new | |
@addresses = Address.find(:all) | |
@e_mail_addresses = EMailAddress.find(:all) | |
@phone_numbers = PhoneNumber.find(:all) | |
respond_to do |format| | |
format.html # new.html.erb | |
format.json { render json: @contact } | |
format.js { render partial: 'form', content_type: :html} | |
end | |
end |
This file contains 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
$(function(){ | |
$('#new_contact').bind('ajax:success', function(e, data) { | |
$.facebox(data); | |
//Set form to remote | |
$("#facebox form").attr("data-remote", "true"); | |
//Hide extra forms (address,email,phonenumber) | |
$("#contact_extras").hide(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment