Cannot render javascript from controller
- by Ermin
I want to display a modal window with an error message, when the user has entered something invalid in a form, but render another action if everything is ok. However, when I try to display the modal window with
render :js => "jQuery.facebox(#{...})"
only the actual javascript called is displayed:
try {
jQuery.facebox(...)
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert('jQuery.facebox(\"<div class=\'error\'>Error</div>\")'); throw e
}