Hi
I have a model class SDResolution.It has fields code and solution.I
have to make the solution not empty .So for that I wrote
validates_presence_of :resolution in the model.So from the view when
I click save nothing is saved to database.This is what I need.But no
error messages are printed and the view goes to next window..How can I
print error messages in the current window?
def update
@sdresolution = SDResolution.find(params[:id]
if @sdresolution.update_attributes(params[:sdresolution]) then
...render next view---
else
redirect_to edit action (or just render edit view again)
end
end
in your view (for edit) just add
<%= error_messages_for(:SDResolution) %>
this will display error messages if there are any on the @sdresolution
object
Hi
I am using ajax submit to remote here..I could succeed this
validation on another place without ajax..I am attaching the code for
this .Could you please go through it and make a suggestion?