# Problem during validation

**URL:** <https://www.ruby-forum.com/t/problem-during-validation/154960>\
**Category:** Rails\
**Created:** [December 5, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/problem-during-validation/154960 "2008-12-05T16:56:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Werner\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ee7513/32.png) [@Werner\_L](https://www.ruby-forum.com/u/Werner_L)\
**Post date:** [December 5, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/problem-during-validation/154960/1 "2008-12-05T16:56:27Z")

</div>

Hi…I need some advice:

A formular which includes 3 partials  
The partial will be chosen by userinput stored in a session

Controller:  
def new  
@booking = Booking.new  
@booking\_partial = partial\_choice(session[:pre][:fahrt]) # 1,2 or 3

this works fine, but if the validation fails the partial will not be  
shown again…!

Looks like the ‘partial\_choice’ is not getting information then. I  
dont see the point where to feed that info in again.

Thanks for your help  
Werner

---

<div class="post-metadata">

**Author:** ![Werner\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ee7513/32.png) [@Werner\_L](https://www.ruby-forum.com/u/Werner_L)\
**Post date:** [December 5, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/problem-during-validation/154960/2 "2008-12-05T19:07:59Z")

</div>

When your save fails, are you re-seeding the @booking\_partial value?

def create  
if @booking.save  
# the happy path  
else  
@booking\_partial = blah blah blah  
render :action =\> ‘new’  
end  
end

---

<div class="post-metadata">

**Author:** ![Werner\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ee7513/32.png) [@Werner\_L](https://www.ruby-forum.com/u/Werner_L)\
**Post date:** [December 5, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/problem-during-validation/154960/3 "2008-12-05T22:34:07Z")

</div>

Thanks…
