From b2c3627afa23eb71d1f3383e36e2dce3a9e95889 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Wed, 5 Jul 2023 09:15:08 +0800 Subject: [PATCH] Fix bug for rails 4.2. --- app/controllers/e_papers_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/e_papers_controller.rb b/app/controllers/e_papers_controller.rb index e863aeb..8e53510 100644 --- a/app/controllers/e_papers_controller.rb +++ b/app/controllers/e_papers_controller.rb @@ -4,7 +4,9 @@ class EPapersController < ApplicationController EmptyImgUrl = "#{EmptyImg}\" style=\"display: none;" def self.custom_widget_data ac = ActionController::Base.new - ac.render_to_string("e_papers/custom_widget_data",:locals=>{:@custom_data_field=>@custom_data_field,:@field_name=>@field_name}) + ac.instance_variable_set(:@custom_data_field, @custom_data_field) + ac.instance_variable_set(:@field_name, @field_name) + ac.render_to_string("e_papers/custom_widget_data") end def index page_no = OrbitHelper.page_number