Fix show page.

This commit is contained in:
邱博亞 2024-07-13 21:33:15 +08:00
parent 6c89f33caa
commit a704b6a1fd
1 changed files with 5 additions and 4 deletions

View File

@ -5,12 +5,13 @@
page = Page.where(url:params['url']).first page = Page.where(url:params['url']).first
@ad_banner_location = 2 @ad_banner_location = 2
@show_back_and_next_flag = 0 @show_back_and_next_flag = 0
if page.methods.include? 'select_option_items'.to_sym if Page.instance_methods.include?(:select_option_items) && ModuleApp.instance_methods.include?(:show_option_items)
ModuleApp.all.select{|tmp| tmp.key.to_s=='event_news'}.each do |module_app| @show_option_items = nil
@show_option_items = module_app.show_option_items rescue nil ModuleApp.all.select{|tmp| tmp.key.to_s=='event_news_mod'}.each do |module_app|
@show_option_items = module_app.show_option_items
end end
page.select_option_items.each do |select_option_item| page.select_option_items.each do |select_option_item|
if !(@show_option_items.nil?) unless @show_option_items.nil?
if select_option_item.field_name == @show_option_items.keys.first.to_s if select_option_item.field_name == @show_option_items.keys.first.to_s
value = YAML.load(select_option_item.value) value = YAML.load(select_option_item.value)
tmp = value[:en] tmp = value[:en]