0
我使用pg_search gem在我的rails应用程序中进行搜索。在我的应用程序的主要模式是:如何使用pg_search进行全球化?
class Book < ActiveRecord::Base
include PgSearch
pg_search_scope :search_everywhere, against: [:author, :title, :description]
end
它在BooksController中的索引行动工作完美与
@books = Book.search_everywhere(params[:search])
。然后我添加宝石“全球化”:
translates :title, :author, :publisher, :description, :fallbacks_for_empty_translations => true
而现在搜索不起作用。
Book.search_everywhere(params[:search])
找不到任何字段。 有人使用pg_search gem和globalize gem?
'不工作' - 这是什么意思? – 2015-03-13 15:17:41
search_everywhere找不到任何字段。 – Victor 2015-03-13 19:15:11