realtime preview is working. but save to object when preview
This commit is contained in:
1 parent
8cc0611c4a
commit
1b70852ff7
11 files changed
+111
-43
No files matched your search
@@ -0,0 +1,15 @@
|
||||
//Preview need a link in form as Ex and a corresponding PUT action in controller
|
||||
//Ex preview trigger:
|
||||
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
|
||||
|
||||
$(document).ready(function() {
|
||||
$("a.preview_trigger").click(function(){
|
||||
$(this).after("<p id='show_preview'></p>");
|
||||
$.ajax({
|
||||
type:"PUT",
|
||||
url:$(this).attr("href"),
|
||||
data:$(this).parents("form").serialize()
|
||||
}).done(function(){ $("#"+start_modal_with_id).modal('show');});
|
||||
return false;}
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user