I'm using rails, but doing all my Javascript unobtrusively using jQuery in application.js
.
Unfortunately, this makes it quite difficult to reference URLs. For example, if I want to give a field autocomplete behavior, I have to hard-code the autocomplete URL in application.js
since the rails url_for
isn't available.
Is it possible to make application.js
use erb? Am I thinking about this the wrong way?