Include in app/assets/javascripts/*.coffee files ?
Include in *.html.erb file with <script></script>
?
Include in partial and render it in view ?
Something else ?
Thank you !
Include in app/assets/javascripts/*.coffee files ?
Include in *.html.erb file with <script></script>
?
Include in partial and render it in view ?
Something else ?
Thank you !
You might want to compress/minify your js scripts for the pages using them for better performance of your app.
To do this, writing your AJAX server calls on a js file like this app/assets/custom.js
and including them on your view file with javascript_include_tag
is the way to go.
write your AJAX script on app/assets/custom.js
then include it in your view file
= javascript_include_tag "custom.js"