Updated.
This commit is contained in:
parent
e08724e0ff
commit
9abbb5d09b
|
@ -133,7 +133,10 @@ class CustomGalleriesController < ApplicationController
|
|||
def self.custom_widget_data
|
||||
@custom_configs = CustomAlbumConfig.all.to_a
|
||||
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
|
||||
def custom_album_widget
|
||||
@custom_album_setting = CustomAlbumSetting.first
|
||||
|
|
|
@ -45,7 +45,7 @@ class CustomAlbum
|
|||
target_model = custom_album_config.bind_model.constantize rescue nil
|
||||
if target_model
|
||||
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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
http://gitlab.tp.rulingcom.com/chiu/custom_gallery.git
|
Loading…
Reference in New Issue