_this.nations = <%= Nation.all.to_json :only => [:id], :methods => :text %>;
When I call my js file in a browser,
/assets/users.js which does a require of the nations file, the
_this.nations variable is populated perfectly. When I try to do a precompile I get the following:
$> rake assets:precompile $> rake aborted! uninitialized constant Nation (in nations.js.erb)
So my question is this: is it possible to reference the
Nation model, or any model, from within the
js.erb file for precompiling? I also tried using my
NationsHelper but my error just changed to uninitialized constant NationsHelper.
I'm fairly new to RoR so if relevant information is needed that I haven't provided, please just ask.