Pedro Cardoso wrote:
Anyway, I'm using this do display the errors in a specific part of my
html, so this is no response to a request.
Everything's a responds to a request. Someone asked if you were doing
when the page first paints.
The following quote is from the manual "Use this in your Ajax response
So, this is my question, how do I do that? How can I add the script
You ensure that the strings with <script> appear around it. If it's in
your controller, and if you are not rendering an Ajax-style request,
then use '<script>' + and + '</script>' around the string it returns.
If you are inside a view, go <script><%= render :etc %></script>
Note that there are few reasons to do the former. Yet there might be
many reasons to do the latter - sharing the first-paint code with the
update code, for example.
escape things. I don't know what function returns those.