# Validation

**URL:** <https://discuss.rubyonrails.org/t/validation/9062>\
**Category:** rubyonrails-talk\
**Created:** [February 20, 2007, 11:34pm UTC](https://discuss.rubyonrails.org/t/validation/9062 "2007-02-20T23:34:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eschottky](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@eschottky](https://discuss.rubyonrails.org/u/eschottky)\
**Post date:** [February 20, 2007, 11:34pm UTC](https://discuss.rubyonrails.org/t/validation/9062/1 "2007-02-20T23:34:09Z")

</div>

I'm very happy so far with the Rails framework (at least compared to J2EE). But I have some trouble whith the valid?() method of ActiveRecord modell objects: In the following code-snippet (behind a post-action the valid-method sometimes is only the first-time triggert. Pressing the back-button in the browser an submitting again ignores the valid-action.

&nbsp;&nbsp;&nbsp;&nbsp;@user = User.new(params[:user]) &nbsp;&nbsp;&nbsp;&nbsp;@country = Country.new(params[:country]) &nbsp;&nbsp;&nbsp;&nbsp;@address = Address.new(params[:address])

&nbsp;&nbsp;&nbsp;&nbsp;@industry\_overview = IndustrieOverview.new(params[:industrie\_overview]) &nbsp;&nbsp;&nbsp;&nbsp;if request.post? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# validation of the input field (before any save action) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@user.valid?() &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@address.valid?() &nbsp;&nbsp;&nbsp;...User.save(@user, @address) rescue puts "Save failed!" Has anybody an idea? Regards from Germany
