Filtering messages to unread and read rails
<p>I want to filter my messages in the website to read and unread. when i click to the unread button there must be just unread messages and this should work as well as reads. I use rails to make this.</p>

<p>In this code i get "param is missing or the value is empty: mailboxer_message" error </p>

<p>index.html.haml</p>

<pre><code>  = button_to "Read", messages_path(unread: 1), class: 'btn btn-success'
  = button_to "Unread", messages_path(unread: 0), class: 'btn btn-success'
</code></pre>

<p>messages.controller.rb</p>

<pre><code>class MessagesController &lt; ApplicationController
      def index
        add_breadcrumb "Inbox", :messages_path
        @messages = current_admin.mailbox.inbox.order('updated_at DESC')
        if params[:unread] == 1
          @messages = mailbox.inbox(:unread =&gt; true)
        elsif params[:unread] == 0
          @messages = mailbox.inbox(:unread =&gt; false)
        end
      end
       .......
      def message_params
        params.require(:mailboxer_message).permit(:conversation_id, :body, :attachment, :recipients, :subject, :unread)
      end
</code></pre>