ruby - Can you inject javascript into an ERB file? -


i working on ruby sinatra app , wanted know if possible inject javascript @ end of 1 erb files routes.rb file. have seen ruby gems before haven't been able find way this.

any appreciated.

alex

you can inject javascript in .erb files this:

  <script>     $(document).ready(function() {       alert('hello world!');     });   </script> 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -