Hi everyone, I'd like to display a text in a div (an error message returned from an ajax form) for 2 seconds and then delete the div content. I do not want the div itself to fade out using scriptacolous - I want the content itself overwritten with an empty string. Is there a way of doing that in rails? Thanks!
on 2007-04-19 00:47
on 2007-04-19 14:40
on 2007-04-19 15:19
on 2007-04-19 17:19
You can also achieve this with RJS / Rails Helpers: if the error message is set thorugh an AJAX response, you would do something like in the rjs partial you render for the response: page.replace_html :div_id "Your erro message here" page.delay(2) do page.replace_html :div_id, "" end if it's a complete page refresh: <div id="div_id"><%= @error_msg</div> <script> update_page do |page| page.delay(2) do page.replace_html :div_id, "" end end </script> On 19 Apr., 15:19, Alan Francis <rails-mailing-l...@andreas-s.net>