In my app; when I submit form, I get this error:
LoadError at /questions
Unable to autoload constant Message, expected /app/models/message.rb to define it
It points to the create
action in the Questions
controller:
@message = current_user.messages.new(:subject => "You have a question from #{@question.sender_id}"`
Message model:
class Mailboxer::Message < ActiveRecord::Base
attr_accessible :notification_id, :receiver_id, :conversation_id
end
Message
model defined? – GauntletMailboxer::
from the name I get the errorTable 'dating_development.messages' doesn't exist
. Which makes sense since there is no messages table, only a notifications table. I just realizedMailboxer::Message
should go into a subdirectory, but I'm going on the wrong path if I start going down that road. – DissimilarUser
model in the question. – BoorMessage
class as anActiveRecord
model. If the message class does not map to a database table then you cannot refer to it from theUser
model as an association. That's why you're getting the errors you see. – Hepner@conversation = Conversation.create!
to see what kind of error I will get. It gives me aActiveRecord::RecordInvalid
that saysValidation failed: Subject can't be blank
. So my thought is it has something to do with the Question model. – Dissimilar