Forum: Ruby on Rails Action Mailer contact form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9ae64bfe61d03b3c6220d830e10faed5?d=identicon&s=25 unknown (Guest)
on 2006-06-06 03:36
(Received via mailing list)
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.
 3.  def send_msg
4.  @contact = Contact.new(params[:contact])
5.     if @contact.valid?
6.     contact =  get_contact
7.     email =  ContactMailer.create_confirm(contact)
8.      render(:text => "<pre>" + email.encoded +  "<pre>")
9.     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:in `new'

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:in `send_msg'
 -e:4
This topic is locked and can not be replied to.