Rails modal windows
Posted on April 28th, 2007 by JeffI dug around for a while yesterday looking into how to close prototype modal windows upon a successful ajax post while ensuring proper error handling. I discovered two excellent blog entries on the subject at javathehutt and richtextblog. Unfortunately, neither of them quite fit my case or fully addressed my issue. Of course, I could just avoid the use of modal windows for my forms, but then what else would I do with myself on a Saturday afternoon? As it turns out, with RJS, what I needed is quite easy.
render :update do |page|
page.call 'top.Windows.close', 'window_id'
end






