This commit is contained in:
zmagod 2017-06-14 10:55:24 +02:00
parent cee052fc19
commit 2d3b5f4308
3 changed files with 11 additions and 6 deletions

View file

@ -10,11 +10,11 @@
pane = $(this);
$.ajax({
url: $(this).attr('data-url'),
url: pane.attr('data-url'),
type: 'GET',
dataType: 'json',
success: function (data) {
var tabBody = $(pane.context.hash).find(".tab-content-body");
success: function(data) {
var tabBody = $(pane.context.hash).find('.tab-content-body');
tabBody.html(data.html);
pane.tab('show');
},
@ -40,6 +40,12 @@
})
}
function showParsedRecords() {
$('#form-records-file').bind('ajax:success', function(evt, data, status, xhr) {
debugger;
});
}
$('.delete-repo-option').initializeModal('#delete-repo-modal');
$('.rename-repo-option').initializeModal('#rename-repo-modal');
$('.copy-repo-option').initializeModal('#copy-repo-modal');
@ -47,7 +53,7 @@
$(document).ready(function() {
loadRepositoryTab();
showParsedRecords();
});
alert('Banana');
})();

View file

@ -186,7 +186,6 @@ class RepositoriesController < ApplicationController
end
def parse_sheet
# byebug
render_404 unless params[:team_id].to_i == current_team.id
repository = current_team.repositories.find_by_id(params[:id])
imported_file = ::ImportRepository.new(file: params[:file],

View file

@ -8,7 +8,7 @@
</div>
<%= bootstrap_form_tag url: parse_sheet_repository_path(repository, format: :json),
html: {'data-type' => 'json',
id: 'form-samples-file'},
id: 'form-records-file'},
remote: :true do |f| %>
<%= f.hidden_field :team_id, value: current_team.id %>
<div class="modal-body">