# Validating model without saving

**URL:** <https://www.ruby-forum.com/t/validating-model-without-saving/88688>\
**Category:** Rails\
**Created:** [January 3, 2006, 9:36am UTC](https://www.ruby-forum.com/t/validating-model-without-saving/88688 "2006-01-03T09:36:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harm\_de\_Laat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de053/32.png) [@Harm\_de\_Laat](https://www.ruby-forum.com/u/Harm_de_Laat)\
**Post date:** [January 3, 2006, 9:36am UTC](https://www.ruby-forum.com/t/validating-model-without-saving/88688/1 "2006-01-03T09:36:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Harm\_de\_Laat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de053/32.png) [@Harm\_de\_Laat](https://www.ruby-forum.com/u/Harm_de_Laat)\
**Post date:** [January 3, 2006, 9:42am UTC](https://www.ruby-forum.com/t/validating-model-without-saving/88688/2 "2006-01-03T09:42:27Z")

</div>

On 1/3/06, Harm de Laat [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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,
