This is hopefully a very basic question, though I couldn’t find a nice
tutorial for that.
I want to make in Rails3 a simple contact form, but with validation.
So I thought, that I would use ActiveRecord for that, but it’s obvious
that I don’t want a table for that.
So the question is how to make such a form with validation in Rails3
DRY way?
I would be grateful for a piece of code for the controller and the
class itself.
This is hopefully a very basic question, though I couldn’t find a nice
tutorial for that.
I want to make in Rails3 a simple contact form, but with validation.
So I thought, that I would use ActiveRecord for that, but it’s obvious
that I don’t want a table for that.
Is it obvious? Do you want to save any of the info entered into the
form?
So the question is how to make such a form with validation in Rails3
DRY way?
I would be grateful for a piece of code for the controller and the
class itself.
I believe you just need to use ActiveModel without the rest of
ActiveRecord.
This is what you want: watch this: #219 Active Model - RailsCasts … this is the Rails 3
way
of doing this ( if you are sure you don’t want to save the data). There
was
a more hacky way in Rails 2.