Damien wrote:> Hi all,
>
> I want to submit the content of a form by mail.
> I don''t want to save it into a DB.
>
May I ask why not? Does your application not use a database at all?
Storing the data in the database is a nice backup and you can still send
the email... trusting that the email gets delivered isn''t as safe. ;-)
</opinion>
> How can I validates the content of this form with validates_presence_of ?
You need an ActiveRecord object in order to use the validations in Rails.
Rick Olsen has a rails weenie entry where he defines the columns in an
ActiveRecord object without a database table... which gives you access
to those validation methods. I did something similar for a
proof-of-concept plugin for interacting with stored procedures... to
validate parameters before executing the procedure. I''m sure that this
same concept could be used in this case.
Here is the post from Rails Weenie:
- http://rubyurl.com/UTf
Hope that helps!
Cheers,
Robby
--
Robby Russell
Founder & Executive Director
PLANET ARGON, LLC
Ruby on Rails Development, Consulting & Hosting
www.planetargon.com
www.robbyonrails.com
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4968 [fax]