diff --git a/app/assets/javascripts/inc/modal-preview.js b/app/assets/javascripts/inc/modal-preview.js index 35195999..44fa62a3 100644 --- a/app/assets/javascripts/inc/modal-preview.js +++ b/app/assets/javascripts/inc/modal-preview.js @@ -7,9 +7,7 @@ $(document).ready(function() { $(this).after(""); $.ajax({ type: 'PUT', - //async : true, url:$(this).attr("href"), - contentType: 'application/javascript; charset=utf-8', data:$(this).parents("form").serialize(), success: function (msg) { $("#"+start_modal_with_id).modal('show'); }, diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb index 1e96907f..a21693aa 100644 --- a/app/controllers/admin/ad_banners_controller.rb +++ b/app/controllers/admin/ad_banners_controller.rb @@ -45,8 +45,8 @@ class Admin::AdBannersController < ApplicationController end def realtime_preview - @ad_banner = AdBanner.first(conditions: { title: params[:title] }).preview_clone - #@ad_banner.update_attributes(params[:ad_banner]).update_attributes(params[:ad_images]) + @ad_banner = AdBanner.find( params[:id] ).preview_clone + @ad_banner.update_attributes(params[:ad_banner])#.update_attributes(params[:ad_images]) end def index diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index c1e406db..79dc647c 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -11,7 +11,7 @@