I have a form that posts back to itself (form action = current browser
URL),
and the validations work properly. I use a little code to determine
whether
they’ve entered information, so if they leave and come back they don’t
have
to refill out the form:
Create new order or get from session
if session[:order].nil?
@order = Order.new
session[:order] = @order
else
@order = session[:order]
end
but now, if they just visit the page (issuing a GET statement), the page
thinks there are errors and shows the error box. Is there a way to skip
error validation for a GET statement? Like:
don’t show model errors
if request.get?
# some magic line to skip model validation
End
Thanks,
Chad