$(".notice").remove();
$(".form-group").removeClass("has-error");

$("#emailBlock").html("#{escape_javascript(@errorEmail[0])}");
$("#emailBlock:contains(Email)").closest(".form-group").addClass("has-error");

$("#nameBlock").html("#{escape_javascript(@errorName[0])}");
$("#nameBlock:contains(Name)").closest(".form-group").addClass("has-error");

$("#contributionBlock").html("#{escape_javascript(@errorContribution[0])}");
$("#contributionBlock:contains()").closest(".form-group").addClass("has-success");
$("#contributionBlock:contains(1)").closest(".form-group").addClass("has-error");

$("#modal_pay").html("#{ j(render 'partials/modal_payment', payment: Payment.new(amount: params[:payments_attributes][:amount], project_id: params[:payments_attributes][:project_id]))}");
$("#modal_payment").modal('show');