From 3c5a0511d228fb3dc00ae860ade1b8ff032cc42f Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 12 Mar 2013 11:23:20 +0100 Subject: Refactoring --- app/controllers/trigger_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/controllers/trigger_controller.rb') diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index fb53c37..e3fc524 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -63,6 +63,18 @@ class TriggerController < ApplicationController end end + def fax_has_been_sent + fax_document = FaxDocument.find(params[:id]) + + if fax_document + # push the partial to the webbrowser + # + new_html = render_to_string("fax_documents/_fax_document", :layout => false, :locals => {:fax_document => fax_document}) + PrivatePub.publish_to("/fax_documents/#{fax_document.id}", "$('#fax_document_" + fax_document.id.to_s + "').replaceWith(escape_javascript(" + new_html + "));") + end + + end + def fax if !params[:fax_account_id].blank? fax_account = FaxAccount.where(:id => params[:fax_account_id].to_i).first -- cgit v1.2.3