I'm trying to create a simple contact form. It might use the database later
for storing the messages, but not yet, I don't think. However, I'd still
like to be able to validate the fields easily, like you would with
ActiveRecord.
How can I do this? I'm new to rails so really don't know where to start.
From: rubyonrails-talk@googlegroups.com [mailto:rubyonrails-
talk@googlegroups.com] On Behalf Of Greg Donald
Sent: Friday, March 27, 2009 5:11 PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: Forms without a database backend
You can validate an ActiveRecord object using valid?.
Have a look at the activerecord_base_without_table plugin:
http://agilewebdevelopment.com/plugins/activerecord_base_without_table.
It's very simple and I use it a lot in my projects. However, if you
ever get into a situation that the framework does a
'describe' ( DESC ) on it, it will fail. Therefore, I modified the
plugin to set the table name to "dual". Works like a charm!