Monday, 19 August 2013

undefined method `new' for Mailbox:Module

undefined method `new' for Mailbox:Module

I have installed the 'mailboxes-app' written by R Kushnir. When I create
the subjects and hit the submit button, the data is saved in my database
but I have trouble displaying the 'show.html.erb' view. I get the
following exception:
undefined method `new' for Mailbox:Module
Here is the content of my show.html.erb file:
<h1><%= conversation.subject%></h1>
<ul>
<%= content_tag_for(:li, conversation.receipts_for(current_user)) do
|receipt|%></ul>
<%message = receipt.message%>
<h3><%= message.subject%></h3>
<p><%= message.body%></p><%end%>
<%= render 'messages/form', conversation: conversation%>
In my conversations_controller.rb file the following lines cause the problem:
def mailbox
@mailbox = current_user.mailbox
end
def conversation
@conversation ||= mailbox.conversations.find(params[:id])
end
Any help would be very welcome.

No comments:

Post a Comment