At this moment I'm implementing errors for my application. I have
created a div for notices and warnings. The application only does AJAX
requests, so it updates both flashes every time a request is made by
At this moment, I add a page.replace to every .rjs file at the end to
update the flashes. If flash[:warning] is nil, it will remove any
previous warnings and a flash[:notice] is added. It works, though this
is not very DRY. What I would like to see is that with every AJAX-
request, these flashes are updated automatically. I guess what I want
is what any .rhtml file does in /app/views/layouts/, but now for .rjs
files. How can this be done?
I hope you understand my question. If you have a better way to report
errors with AJAX requests, please let me know. I'm eager to learn!