diff --git a/app/views/event_news_mods/show.html.erb b/app/views/event_news_mods/show.html.erb index 82329e7..f70e658 100644 --- a/app/views/event_news_mods/show.html.erb +++ b/app/views/event_news_mods/show.html.erb @@ -5,12 +5,13 @@ page = Page.where(url:params['url']).first @ad_banner_location = 2 @show_back_and_next_flag = 0 - if page.methods.include? 'select_option_items'.to_sym - ModuleApp.all.select{|tmp| tmp.key.to_s=='event_news'}.each do |module_app| - @show_option_items = module_app.show_option_items rescue nil + if Page.instance_methods.include?(:select_option_items) && ModuleApp.instance_methods.include?(:show_option_items) + @show_option_items = 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 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 value = YAML.load(select_option_item.value) tmp = value[:en]