From 3c95f053ab70a295bebde06c484e0ba9e5b1a41b Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 15 Apr 2014 17:00:07 +0800 Subject: [PATCH] Fix gem dependency and site search rescue nil --- Gemfile | 2 +- app/controllers/site_search_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index c98450e..0a0fa3f 100644 --- a/Gemfile +++ b/Gemfile @@ -102,7 +102,7 @@ group :test, :development do gem "rspec", "~> 2.0" gem "rspec-rails", "~> 2.0" gem "factory_girl_rails" - gem "shoulda-matchers" + # gem "shoulda-matchers" gem "simplecov" gem "delorean" gem "watchr" diff --git a/app/controllers/site_search_controller.rb b/app/controllers/site_search_controller.rb index d730054..307d21d 100644 --- a/app/controllers/site_search_controller.rb +++ b/app/controllers/site_search_controller.rb @@ -45,7 +45,7 @@ class SiteSearchController < ApplicationController tmp[:content] = "" tmp[:matches] = 0 mod[:fields].each do |f| - value = eval("r.#{f}").gsub(/<\/?[^>]*>/, "").gsub(/ /i,"") + value = eval("r.#{f}").gsub(/<\/?[^>]*>/, "").gsub(/ /i,"") rescue "" if f=="title" or f=="name" tmp[:title] = value