Forum: Ruby on Rails validating model without saving

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.
F734b6ca0eb2ebd01744224437a72498?d=identicon&s=25 Harm de Laat (Guest)
on 2006-01-03 09:36
(Received via mailing list)
Hi all,

I would like to validate my model without actually saving it to the
database.

Actualy I need it as follows:

User enters user details in a post form.
When the user submits the form I would like the form to be validated.
However, when validation passes, I don't want to save the model yet, but
I
would like to store it in Session context.

Is this possible at all? And if so, how can I achieve my goal?

Regards,

Harm de Laat
3bec49196b296ac7c201412642c7a2b1?d=identicon&s=25 Rodrigo Alvarez (papipo)
on 2006-01-03 09:42
(Received via mailing list)
On 1/3/06, Harm de Laat <harmdelaat@gmail.com> wrote:
> However, when validation passes, I don't want to save the model yet, but I
> would like to store it in Session context.
>
> Is this possible at all? And if so, how can I achieve my goal?


I guess that you can do it with model.valid?

Regards,
This topic is locked and can not be replied to.