Merge branch 'nccu_fix' of github.com:Rulingcom/NCCU into nccu_fix_matt
This commit is contained in:
commit
fe4aadef29
2
Gemfile
2
Gemfile
|
@ -26,7 +26,7 @@ gem 'mysql2'
|
|||
gem 'nokogiri'
|
||||
gem 'radius'
|
||||
gem 'rake'
|
||||
gem 'remotipart'
|
||||
# gem 'remotipart'
|
||||
gem 'resque' # background jobs
|
||||
gem 'resque-scheduler' # job scheduling
|
||||
gem 'resque-restriction'
|
||||
|
|
|
@ -2,6 +2,12 @@ $(document).on('click', '#ajax_form_submit', function(){
|
|||
$('#ajaxForm').ajaxSubmit({
|
||||
beforeSubmit: function(a,f,o) {
|
||||
o.dataType = 'script';
|
||||
if (o.dataType == 'script') {
|
||||
o.url = o.url.split('?'); // split on GET params
|
||||
if (o.url[0].substr(-3) != '.js') o.url[0] += '.js'; // force rails to respond to respond to the request with :format = js
|
||||
o.url = o.url.join('?'); // join on GET params
|
||||
alert(o.url)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -17,4 +17,4 @@
|
|||
//= require side_bar_history
|
||||
//= require rss
|
||||
//= require ajax_form
|
||||
//= require jquery.remotipart
|
||||
//= require inc/ajax_setting
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= form_for :asset, :url => admin_assets_path(:uploader => true), :remote => true do |f| %>
|
||||
<%= form_for :asset, :url => admin_assets_path(:uploader => true), :html => {:id => 'ajaxForm', :multipart => true } do |f| %>
|
||||
<div class="modal-header">
|
||||
<h3><%= t 'admin.file_upload' %></h3>
|
||||
</div>
|
||||
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
<div style="position: absolute; width: 100%; bottom: 0;">
|
||||
<div class="modal-footer">
|
||||
<%= f.submit t(:create), :class => "btn btn-primary" %>
|
||||
<a id='ajax_form_submit' class="btn btn-primary"><%= t(:create) %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Reference in New Issue