% params = OrbitHelper.params page = @page || Page.where(url:params['url']).first @layout_type = 0 if page.methods.include?(:select_option_items) @show_option_items = ModuleApp.where(key: 'gallery').last.show_option_items rescue nil page.select_option_items.each do |select_option_item| if !(@show_option_items.nil?) && select_option_item.field_name == @show_option_items.keys.first.to_s value = YAML.load(select_option_item.value) tmp = value[:en] I18n.with_locale(:en) do if tmp == t('gallery.grid_style') @layout_type = 0 elsif tmp == t('gallery.card_style') @layout_type = 1 elsif tmp == t('gallery.slideshow_style') @layout_type = 2 end end end end end data = action_data %> <% if @layout_type==0 %> <%= render_view %> <% elsif @layout_type==1 %>