From d6b92fc604387b8252ff278682c2aa3ed6f41fff Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 22 May 2012 20:00:07 +0800 Subject: [PATCH] Fixed bugs for nccu --- app/controllers/orbit_backend_controller.rb | 6 +++--- app/views/kaminari/_gap.html.erb | 2 +- .../panel/news/front_end/news_bulletins/index.html.erb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/orbit_backend_controller.rb b/app/controllers/orbit_backend_controller.rb index 9648f327..339f7ede 100644 --- a/app/controllers/orbit_backend_controller.rb +++ b/app/controllers/orbit_backend_controller.rb @@ -74,7 +74,7 @@ class OrbitBackendController< ApplicationController when 'categories' a = Array.new objects.each do |object| - a << object if value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) + a << object if (value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) rescue nil) end objects = a.uniq when 'tags' @@ -99,9 +99,9 @@ class OrbitBackendController< ApplicationController if s case s.class.to_s when "String" - s.downcase + s.downcase rescue '' when "I18nVariable" - s[I18n.locale].downcase + s[I18n.locale].downcase rescue '' else nil end diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb index 8807aafe..c680799d 100644 --- a/app/views/kaminari/_gap.html.erb +++ b/app/views/kaminari/_gap.html.erb @@ -5,4 +5,4 @@ per_page: number of items to fetch per page remote: data-remote -%> -
  • <%= raw(t 'views.pagination.truncate') %>
  • + diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb index 322b64c0..6968a482 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb @@ -17,7 +17,7 @@ <% @news_bulletins.each do |post| %> - <%= image_tag post.image %> + <%= image_tag post.image rescue nil %> <%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %> <%= post.subtitle[I18n.locale].html_safe %>