Now I'm using a gem called 'mailboxer' for messaging system.https://github.com/ging/mailboxer I'd like to implement 'keyword search function' , with that I should be able to search conversations and messages of my mailbox, either it should be from inbox, sentbox, trash or drafts.
however this gem has given a function
search_messages(query)
, but it seems not working.
Here's a function to retrieve all conversations which subject, body or recipient/sender's username includes a given string. You can tweak it little bit to fit your scenario or open an issue on their github repo.