I solved this problem by catching the error and displaying it to the user.
Something similar to the following (off the top of my head, not really
looking at code at the moment):
begin
if mymodel.save
# everything ok
....
else
flash[:warning] = "error saving object"
end
rescue => e
flash[:warning] = e
end
render :action=>''new'' and return if flash[:warning]
redirect_to :action=>''show'', :id=>mymodel.id
On Sun, 18 Dec 2005, olivier Hericord wrote:
> hi,
>
> using date_select right from a generated scaffold code leads to an
> error if an impossible date is selected (like the 31 of february)
>
> can''t get a way to correct this via a validation....
> in fact that make sens because in the model i have the
''dateofbirth''
> object which is a date object....
>
> so providing an impossible day-month-year trio leads to an impossible
> creation of the date object...
>
>
> anyone with a solution?
>
>
> thanks
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>