This commit is contained in:
BoHung Chiu 2023-07-05 09:26:28 +08:00
parent e08724e0ff
commit 9abbb5d09b
8 changed files with 6 additions and 2 deletions

View File

@ -133,7 +133,10 @@ class CustomGalleriesController < ApplicationController
def self.custom_widget_data def self.custom_widget_data
@custom_configs = CustomAlbumConfig.all.to_a @custom_configs = CustomAlbumConfig.all.to_a
ac = ActionController::Base.new ac = ActionController::Base.new
ac.render_to_string("custom_galleries/custom_widget_data",:locals=>{:@custom_data_field=>@custom_data_field,:@custom_configs=>@custom_configs,:@field_name=>@field_name}) ac.instance_variable_set(:@custom_data_field, @custom_data_field)
ac.instance_variable_set(:@custom_configs, @custom_configs)
ac.instance_variable_set(:@field_name, @field_name)
ac.render_to_string("custom_galleries/custom_widget_data")
end end
def custom_album_widget def custom_album_widget
@custom_album_setting = CustomAlbumSetting.first @custom_album_setting = CustomAlbumSetting.first

View File

@ -45,7 +45,7 @@ class CustomAlbum
target_model = custom_album_config.bind_model.constantize rescue nil target_model = custom_album_config.bind_model.constantize rescue nil
if target_model if target_model
target_record = target_model.where(custom_album_config.uid_field=>self.bind_uid).first target_record = target_model.where(custom_album_config.uid_field=>self.bind_uid).first
target_record.send(custom_album_config.custom_record_callback,num) target_record.send(custom_album_config.custom_record_callback,num) if target_record
end end
end end
end end

1
source.txt Normal file
View File

@ -0,0 +1 @@
http://gitlab.tp.rulingcom.com/chiu/custom_gallery.git