Skip to content
Browse files

Cleanup Upload#index

Using the content_for trick in the view doesn't work with the asset pipeline.
We have to include upload.js in the dradis3.js bundle. Some of its code is
the same we have in configurations.js so we can remove it.
  • Loading branch information...
1 parent 495b1c2 commit b6838a7665c108739dcccdbbc3903825dcf728db @etdsoft etdsoft committed
View
3 app/assets/javascripts/dradis3.js
@@ -1,4 +1,5 @@
//= require jquery
//= require jquery_ujs
//= require jquery.form
-//= require configurations
+//= require configurations
+//= require upload
View
9 app/assets/javascripts/upload.js
@@ -1,12 +1,3 @@
-jQuery.ajaxSetup({
- beforeSend: function(xhr) {
- xhr.setRequestHeader("Accept", "text/javascript");
- var token = $("meta[name='csrf-token']").attr("content");
- xhr.setRequestHeader("X-CSRF-Token", token);
- }
-});
-
-
$(function(){
$('form').ajaxForm({dataType: 'script'});
View
1 app/views/layouts/dradis3.html.erb
@@ -7,7 +7,6 @@
<%= javascript_include_tag 'dradis3' %>
<%= stylesheet_link_tag 'dradis3' %>
<%= csrf_meta_tag %>
- <%= yield(:head) %>
</head>
<body>
View
3 app/views/upload/index.html.erb
@@ -1,7 +1,4 @@
<% title 'Upload Manager' %>
-<% content_for :head do -%>
-<%= javascript_include_tag 'upload' %>
-<% end -%>
<p>Use the form below to upload output files from other tools. Once you have
uploaded them you can process with the different <a href="#" id="available">plugins available</a>. </p>

0 comments on commit b6838a7

Please sign in to comment.
Something went wrong with that request. Please try again.