Action Mailer contact form


#1

I am trying to use Rails and the Action mailer to create a simple
contact
form on a website. I am using a table-less model to validate the form
contents, then trying to use the Action Mailer chapter of the “Agile Web
Development
with Rails” book as a pattern to develop the send e-mail portion. I am
having trouble getting it working and was hoping someone could point me
in the
right direction. Thanks.

====================================================

  1. class ContactController < ApplicationController
  2. def send_msg
  3. @contact = Contact.new(params[:contact])
  4. if @contact.valid?
    
  5. contact =  get_contact
    
  6. email =  ContactMailer.create_confirm(contact)
    
  7.  render(:text => "<pre>" + email.encoded +  "<pre>")
    
  8. flash[:notice] = "Message  Sent"
    

10.# redirect_to :action => ‘index’
11. else
12. render :action => ‘index’
13. end
14. end
15.
16. def get_contact
17. @contact
18. end
19.
20. end

=========================================================

No rhtml, rxml, rjs or delegate template found for confirm
RAILS_ROOT: ./script/…/config/…
Application trace is as follows:

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:387:i
n `find_template_extension_for’

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:323:in
`pick_template_extension’

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:238:in
`render_file’

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:272:in
`render’

c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:363:in
`render’

c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:358:in
`render_message’

c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:306:in
`create!’

c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:267:in
initialize' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:innew’

c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:226:in
method_missing' #{RAILS_ROOT}/app/controllers/contact_controller.rb:7:insend_msg’
-e:4