I have a JavaScript file to use with a view. There needs to be Ruby code in it, and I need to do render
in Ruby, so I understand that I can\'t put the JavaScrip
you can do this by
render :partial => "myfile"
you have to keep your file in controller's view directory with name _myfile.js.erb
Now you can write your own code (js,ruby) here and probably can separate out js with javascript_include_tag to avail asset pipline
This file will be first rendered by erb engine and then as javascript.