Fix gem dependency and site search rescue nil

This commit is contained in:
manson 2014-04-15 17:00:07 +08:00
parent b1d35c59bf
commit 3c95f053ab
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ group :test, :development do
gem "rspec", "~> 2.0" gem "rspec", "~> 2.0"
gem "rspec-rails", "~> 2.0" gem "rspec-rails", "~> 2.0"
gem "factory_girl_rails" gem "factory_girl_rails"
gem "shoulda-matchers" # gem "shoulda-matchers"
gem "simplecov" gem "simplecov"
gem "delorean" gem "delorean"
gem "watchr" gem "watchr"

View File

@ -45,7 +45,7 @@ class SiteSearchController < ApplicationController
tmp[:content] = "" tmp[:content] = ""
tmp[:matches] = 0 tmp[:matches] = 0
mod[:fields].each do |f| mod[:fields].each do |f|
value = eval("r.#{f}").gsub(/<\/?[^>]*>/, "").gsub(/&nbsp;/i,"") value = eval("r.#{f}").gsub(/<\/?[^>]*>/, "").gsub(/&nbsp;/i,"") rescue ""
if f=="title" or f=="name" if f=="title" or f=="name"
tmp[:title] = value tmp[:title] = value