I'm using simple search in my blog:
post.rb
has_rich_text :content
def self.search(search)
where('title ILIKE ? OR content ILIKE ?', "%#{search}%", "%#{search}%")
end
post_controller.rb
@posts = if params[:search]
Post.search(params[:search]).order('created_at DESC')
else
Post.all.order('created_at DESC')
end
But after I added the trix editor, post content search stopped working(for titles - works)