Problem during validation


#1

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


#2

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


#3

Thanks…