0

I'm using Rails 3.2 (old and unsupported, I know). It's a legacy application upgrade, and we didn't have controller specific js/css files previously, we have a different structure for them.

The problem is that the asset pipeline looks for MyController.js when I load MyController or worse: when I load a method it looks for a specific JS or CSS for that view.

Since I have this setting in production.rb: config.assets.compile = false it won't fall back to the asset pipeline if something isn't compiled. This causes errors like device/passwords.js isn't precompiled which is frustrating because I don't want/need a separate js file for this.

Rails 3.2 automatically requires these controller specificjs and , nothing in my code that does that that I know of and I've checked for this: <%= javascript_include_tag params[:controller] %> which also doesn't exist in my code.

I want it to stop doing that so that I don't have to arbitrarily create one js file for every action that I'm not going to use.

Is that possible in rails 3.2?

Jono
  • 3,393
  • 6
  • 33
  • 48
  • Post your application.html.erb layout as well as your application.js directory and your config/initializers/assets (that might be rails 4+ so also post) your config.application.rb file. – bkunzi01 Sep 21 '16 at 18:47
  • By default, rails 3.2 doesn't load assets by controller so it's probably an issue with the precompile request in your config if I had to guess. – bkunzi01 Sep 21 '16 at 18:52

1 Answers1

0

Why rails was loading controller#method javascript and CSS is because of the line <%= javascript_include_tag params[:controller] %> which I had removed, but failed to reload my rails server - which was NGINX and I guess it was caching the previous results! It fixed it afterwards.

Jono
  • 3,393
  • 6
  • 33
  • 48