in the application.rhtml I am trying to check and see if any of the
models associated with this controller have errors (i.e. -
model.errors.count > 0). Does anyone know how to do that using
reflection or something since I will not know what models are present
in this controller or action of the controller since it is in the
shared application.rhtml file??
In your controller you could define a flash message:
def create @thing = Thing.new(params[:thing])
if @thing.save
flash[:notice] = “Thing was saved correctly.”
else
flash[:notice] = “Thing could not be saved: #{@thing.errors.to_s}”
end
end