title: Rails - NameError undefined local variable or method `conversation'
body: <p>Rails newbie here. I am trying out this Mailboxer gem and was implementing in on my website. I want to create an inbox system but somehow its not showing me the conversations show page. It gives me the following error:</p>
  
  <blockquote>
    <p>NameError in Conversations#show Showing
    C:/Sites/myinbox/app/views/conversations/show.html.haml where
    line #6 raised:</p>
    
    <p>undefined local variable or method `conversation'</p>
  </blockquote>
  
  <p>I don't where I am going wrong. I am following a tutorial <a href="http://josephndungu.com/tutorials/private-inbox-system-in-rails-with-mailboxer" rel="nofollow">here</a> on how to set it up but I am not getting the conversations to show.</p>
  
  <p>I would really appreciate if you'd help!</p>
  
  <p>show.html.haml</p>
  
  <pre><code>.row
    .spacer
    .col-md-6
      = link_to "Compose", new_conversation_path, class: "btn btn-success"
    .col-md-6.text-right
      - if conversation.is_trashed?(current_user) &lt;!-- LINE 6 --&gt;
        = link_to 'Untrash', untrash_conversation_path(conversation), class: 'btn btn-info', method: :post
      - else
        = link_to 'Move to trash', trash_conversation_path(conversation), class: 'btn btn-danger', method: :post, |
          data: {confirm: 'Are you sure?'}                                                                        |
  .row
    .spacer
    .col-md-4
      .panel.panel-default
        .panel-body
          = render 'mailbox/folders'
    .col-md-8
      .panel.panel-default
        .panel-body
          = render partial: 'messages'
        .panel-footer
          / Reply Form
          = form_for :message, url: reply_conversation_path(conversation) do |f|
            .form-group
              = f.text_area :body, placeholder: "Reply Message", rows: 4, class: "form-control"
            = f.submit "Reply", class: 'btn btn-danger pull-right'
  </code></pre>
  
  <p>conversations_controller.rb</p>
  
  <pre><code>class ConversationsController &lt; ApplicationController
    before_action :authenticate_user!
  
    def new
    end
  
    def create
      recipients = User.where(id: conversation_params[:recipients])
      conversation = current_user.send_message(recipients, conversation_params[:body], conversation_params[:subject]).conversation
      flash[:notice] = "Your message was successfully sent!"
      redirect_to conversation_path(conversation)
    end
  
    def show
      @receipts = conversation.receipts_for(current_user).order("created_at ASC")
      # mark conversation as read
      conversation.mark_as_read(current_user)
    end
  
  
    def reply
      current_user.reply_to_conversation(conversation, message_params[:body])
      flash[:notice] = "Your reply message was successfully sent!"
      redirect_to conversation_path(conversation)
    end
  
    def trash
      conversation.move_to_trash(current_user)
      redirect_to mailbox_inbox_path
    end
  
    def untrash
      conversation.untrash(current_user)
      redirect_to mailbox_inbox_path
    end
  
  
    private
  
    def conversation_params
      params.require(:conversation).permit(:subject, :body,recipients:[])
    end
  
    def message_params
      params.require(:message).permit(:body, :subject)
    end
  end
  </code></pre>