Created
March 5, 2014 06:40
-
-
Save axilaris/9362295 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
<%= form_for(@payment_account) do |f| %> | |
<% if @payment_account.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@payment_account.errors.count, "error") %> prohibited this payment_account from being saved:</h2> | |
<ul> | |
<% @payment_account.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :name %><br> | |
<%= f.text_field :name %> | |
</div> | |
<div class="field"> | |
<%= f.label :data %><br> | |
<%= f.text_field :data %> | |
</div> | |
<div id="skillSet"> | |
<%= render partial: "skills_form" %> | |
</div> | |
<a href="javascript:;" id="addNewTag">Add New Tag</a> | |
<div class="actions"> | |
<%= f.submit %> | |
</div> | |
<div class="hide" id="new_skills_form" style="visibility: hidden"> | |
<%= render partial: "skills_form", locals: {skill: false} %> | |
</div> | |
<% end %> | |
<%= content_for :js do %> | |
<script type='text/javascript'> | |
$(document).ready(function(){ | |
$("#addNewTag").click(function(){ | |
$("#skillSet").append($("#new_skills_form").html()); | |
}); | |
$("#removeTag").click(function(){ | |
console.log("removetag"); | |
$(this).parent('div').remove() | |
}); | |
}); | |
</script> | |
<%- end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment