From e6fde501e9dda7be5b6e81cc8488592d777d3f7c Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Wed, 5 Jul 2023 09:12:46 +0800 Subject: [PATCH] Fix bug for rails 4.2. --- app/controllers/archives_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 5eb5b0d..c4dc4cb 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -1,7 +1,9 @@ class ArchivesController < ApplicationController def self.custom_widget_data ac = ActionController::Base.new - ac.render_to_string("archives/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("archives/custom_widget_data") end #avoid the categories to be not in the ArchiveCategory def serve_cmap