It turns out that you should not put the module prefix in front of
the model class. The video shows this to be the case, but the manual
says otherwise. Here''s what fixed it:
class Contact < ActionMailer::Base
def feedback(from, subject, body)
...[snipped]...
end
end
On Jun 18, 2005, at 10:02 PM, Duane Johnson wrote:
> I''m making a component called "feedback" which is simply
a model,
> view and controller to gather feedback and send it as an email to
> the site''s administrator.
>
> However, when the form is posted back and the model is referenced,
> it seems unable to find the model class:
>
> uninitialized constant Contact
>
> My directory structure looks like this:
> components/
> feedback/
> contact.rb
> contact_controller.rb
> contact/
> index.rhtml
>
> Here''s the controller:
> class Feedback::ContactController < ApplicationController
> def index; ...[snipped]...; end
>
> def send_mail
> Contact.deliver_feedback(...[snipped]...)
> end
> end
>
> And the model:
> class Feedback::Contact < ActionMailer::Base
> def feedback(from, subject, body)
> ...[snipped]...
> end
> end
>
> Documentation on components seems scant... does anyone know what I
> might be doing wrong here? I''m using Rails 12.1 for this project.
>
> Thank-you,
> Duane Johnson
> (canadaduane)
>
>
Duane Johnson
(canadaduane)
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails