Note that there are some explanatory texts on larger screens.

plurals
  1. POcontact form uninitialized constant contactcontroller
    primarykey
    data
    text
    <p>Hello I am trying to implement a contact form following this guide: <a href="http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/" rel="nofollow">Contact form in Rails 3</a> </p> <p>I am not using google apps but 1and1's smtp. </p> <p>The error I get when I attempt to send the form is </p> <pre><code>Processing by ContactController#create as HTML Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"N48ORAhmDqTO7X2wsRlslMJ3l+v=", "message"=&gt;{"name"=&gt;"Patrick", "email"=&gt;"patrick@yahoo.com", "subject"=&gt;"Hello", "body"=&gt;"Hello ME"}, "commit"=&gt;"Send"} NameError (uninitialized constant ContactController::NotificationsMailer): app/controllers/contact_controller.rb:11:in `create' </code></pre> <p>After some attempts at tweaking, I ended up just copying and pasting the code from the guide. Still have a problem.</p> <pre><code>class ContactController &lt; ApplicationController def new @message = Message.new end def create @message = Message.new(params[:message]) if @message.valid? NotificationsMailer.new_message(@message).deliver redirect_to(root_path, :notice =&gt; "Message was successfully sent.") else flash.now.alert = "Please fill all fields." render :new end end end </code></pre> <p>NotificationMailer</p> <pre><code>class NotificationMailer &lt; ActionMailer::Base default from: "noreply@misawahousing.com" default to: "info@misawahousing.com" def new_message(message) @message = message mail(subject: "[misawahousing.com] #{message.subject}") end end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload