ssssss
1
Hi
on the code below the validates all the form fields
if @client.save
flash[:notice] = 'Client was successfully created.'
redirect_to :action => 'list'
else
render :action => 'new'
end
how can I do this action without having to save the object?
ie
if validate
#move on to next stage
else
redner :action => new
end
ssssss
2
how can I do this action without having to save the object?
ie
if validate
if @client.valid?
According ot the API docs: “Runs validate and validate_on_create or
validate_on_update and returns true if no errors were added otherwise
false”.
Julian
ssssss
3
thanks, seems to work well