Created
December 19, 2013 10:35
-
-
Save thiagovsk/8037312 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
<script type="text/javascript"> | |
$(function() { | |
function cutAndPaste(from, to) { | |
$(to).append(function() { | |
return $(from + " option:selected").each(function() { | |
this.outerHTML; | |
}).remove(); | |
}); | |
} | |
$("#forward").off("click").on("click", function() { | |
cutAndPaste("#sourceSelect", "#destinationSelect"); | |
}); | |
$("#backward").off("click").on("click", function() { | |
cutAndPaste("#destinationSelect", "#sourceSelect"); | |
}); | |
}); | |
</script> | |
<%= render "navbar" %> | |
<div class="page-header"> | |
<%= form_for(@place) do |f| %> | |
</div> | |
<% if @place.errors.any? %> | |
<div class="alert alert-danger"> | |
<ul> | |
<% @place.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label "Nome" %><br /> | |
<%= f.text_field :name %> | |
</div> | |
<div class="actions"> | |
<%=link_to raw("<i class=\"icon-white icon-arrow-left\"> Voltar </i>"), | |
places_path , | |
class: "btn btn-warning"%> | |
<%= f.submit "Criar Local de Atendimento", :class => 'btn-success btn' %> | |
<div style="float: right;"> | |
<select name="sourceSelect" id="sourceSelect" multiple="multiple" size="3"> | |
<%= options_for_select(@type_existing) %> | |
</select> | |
<input type="button" name="forward" id="forward" value=">" /> | |
<input type="button" name="backward" id="backward" value="<" /> | |
<select name="destinationSelect" id="destinationSelect" multiple="multiple" size="3"> | |
<%= options_for_select(@type_desired) %> | |
</select> | |
</div> | |
</ul> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment