1
0
Fork 0

Handle nil description, not_found case

This commit is contained in:
magnolia-fan 2011-10-20 22:16:46 +04:00
parent 0dc5f24c6c
commit 0349588c33
2 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,9 @@ class window.Search
else if data.status == 'fail' else if data.status == 'fail'
_search.hideSpinner() _search.hideSpinner()
_page.print data.html _page.print data.html
else if data.status == 'not_found'
_search.hideSpinner()
alert "Not found"
false false
showSuggestions: (values) -> showSuggestions: (values) ->

View File

@ -11,6 +11,6 @@ class Artist < ActiveRecord::Base
end end
def prepare_description def prepare_description
self.desc.gsub! /[\[<].*?[\]>]/, '' self.desc.gsub! /[\[<].*?[\]>]/, '' unless self.desc.nil?
end end
end end