ActiveRecord validation with ajax calls

  I have a model class ServiceDeskResolution.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?

View code (define_sd_resolution.rhtml)
<%= error_messages_for 'service_desk_resolution' %> #This not

I have good suggestion if you spend 5 minutes to, and download their script :D. I hope
it will help you.

I am not sure your code here, maybe it should be :

def sd_resolution_save[:sd_resolution])
     render :action => "sd_resolution_save.rjs"
     render :action => 'define_sd_resolution'
     #render :file => "#{RAILS_ROOT}/public/define_sd_resolution.rhtml"
     # I am not sure with render file.

your code before dont have block to break error, so it will execute
:action => "sd_resolution_save.rjs" although it is error or failed

Good Luck,