Rails can't require a javascript file that exists in the same folder -
just deployed rails 5.x application , installed theme. theme's contents located within app/assets/javascripts/theme-js , app/assets/stylesheets/theme-files folders.
inside of app/assets/javascripts/application.js file includes following:
//= require jquery //= require jquery_ujs //= require_tree . // required smartadmin theme //= require theme-js/app.config.js.erb //= require theme-js/app.js and inside of app/assets/javascripts/theme-js folder have following files (included theme):
- app.config.js.erb
- app.js
- application.js
the problem i'm having inside of application.js file contains line states: //= require app.config, rails generates me error stating following:
couldn't find file 'app.config' type 'application/javascript'
even though app.config.js.erb in same folder application.js. there reason why happen? can't figure out why won't work. i've tried //= require app.config.js , //= require app.config.js.erb , neither 1 of them work.
i noticed //= require ./app.config appears work whereas //= require app,config doesn't. new rails 5.x perhaps? i'd have modify of require statements fit unless i'm missing something.
problem solved. needed add custom theme-js , theme-css folder assets pipeline rails can search folders appropriate files when using //= require <file>. assuming needed do, although i'm not sure if it's best practice.
Comments
Post a Comment