0

I'd like to implement "text search function" over body part of tons messages. If anyone knows how to implement that to "Mailboxer", please show me how. I have no idea how it goes.

When I access example.com/messages/search?page=3&search=test&utf8=%E2%9C%93 This code won't send back correct result...

def search
  @search = params[:search]
  @a = current_user.search_messages(@search)
  @messages = Kaminari.paginate_array(@a).page(params[:page]).per(10)
  render :received
end
MKK
  • 2,713
  • 5
  • 31
  • 51

1 Answers1

0

This can be a good start: https://github.com/frodefi/rails-messaging#enabling-search

Edo
  • 386
  • 4
  • 11
  • Thanks. It's already all done. What I need to know is how to code in controller(fetch the records that includes keyword in body part), and views(search keyword input) Do you have any idea? They never talk about how to fetch records with search keyword. – MKK Jul 05 '12 at 00:36
  • I take it back. I succeeded at passing search keyword query to controller. Eventhough it's going okay, controller won't send back correct result to view. I edited my question so please take a look at that. – MKK Jul 05 '12 at 01:03