title: How do I solve Mailboxer reply undefined method `is_trashed?' error?
body: <p>I'm trying to get Mailboxer gem working in a Rails 3.1 app... I have the New message function working, but replying to a conversation keeps giving me an <code>undefined method 'is_trashed?' for nil:NilClass</code> error.</p>
  
  <p>I've been following the read me info on the gem site, <a href="https://github.com/ging/mailboxer" rel="nofollow">here</a>, and looking at the example mailboxer app <a href="https://github.com/RKushnir/mailboxer-app" rel="nofollow">here</a>.</p>
  
  <p>Here's my controller:</p>
  
  <pre><code>class ConversationsController &lt; ApplicationController
    before_filter :authenticate_user!
    helper_method :mailbox, :conversation
  
    def show
      @conversation ||= mailbox.conversations.find(params[:id])
    end
  
    def create
      recipient_emails = conversation_params(:recipients).split(',')
      recipients = User.where(email: recipient_emails).all
  
      conversation = current_user.send_message(recipients, *conversation_params(:body, :subject)).conversation
  
      redirect_to conversation
    end
  
    def reply
      conversation = current_user.reply_to_conversation(conversation, *message_params(:body)).conversation
      redirect_to conversation
    end
  
    def trash
      conversation.move_to_trash(current_user)
      redirect_to :back
    end
  
    def untrash
      conversation.untrash(current_user)
      redirect_to :back
    end
  
    private
  
    def mailbox
      @mailbox ||= current_user.mailbox
    end
  
    def conversation
      @conversation ||= mailbox.conversations.find(params[:id])
    end
  
    def conversation_params(*keys)
      fetch_params(:conversation, *keys)
    end
  
    def message_params(*keys)
      fetch_params(:message, *keys)
    end
  
    def fetch_params(key, *subkeys)
      params[key].instance_eval do
        case subkeys.size
        when 0 then self
        when 1 then self[subkeys.first]
        else subkeys.map{|k| self[k] }
        end
      end
    end
  end
  </code></pre>
  
  <p>And here is my reply form:</p>
  
  <pre><code>&lt;%= simple_form_for :message, url: [:reply, conversation] do |f| %&gt;
    &lt;%= f.input :body, as: :text, :input_html =&gt; { :cols =&gt; 50, :rows =&gt; 3 } %&gt;
    &lt;div &gt;
      &lt;%= f.button :submit, "Send", class: 'btn btn-primary' %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>New conversations are working, but for some reason I keep getting errors on the <code>reply_to_conversation</code> functionality. Any help would be much appreciated!</p>