0

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 !

mjerem34
  • 39
  • 5

1 Answers1

0

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" 
sa77
  • 3,563
  • 3
  • 24
  • 37