On Oct 4, 4:36 pm, Peter Ab <[EMAIL PROTECTED]> wrote:
> my problem is that if the user selects a ball but forgets to select a
> ball size, i go back to the form but it seems that i've lost all memory
> of @picked_ball. i don't want to user to have to select the ball again.
> i want it to be selected when the page is redisplayed with the error.
> do i have to put this stuff in the session? i hope i don't because
> there are actually a lot more items on the page, i've cut it down so my
> post isn't quite as long.
>
Typically one deals with this by re-rendering the form, not by
redirecting. You'll very often see this pattern:
@foo = Foo.new params[:foo]
if @foo.save
#success
redirect_to ...
else
render :action => 'new'
end
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---