Reputation: 16335
Is there any way to load JavaScript from public
folder before JavaScript-files from assets/javascript
?
Upvotes: 3
Views: 4470
Reputation: 1
It automatically includes all the .js from public directory.. just make sure you have //= require_tree . in application.js (rails do it itself)
Upvotes: 0
Reputation: 2276
You can still use the classic javascript_include_tag
in your layout.
Given I have a file in_public.js
in my public folder.
<%= javascript_include_tag "/in_public" %>
Upvotes: 9
Reputation: 2057
Sure. Just add
//= require_tree public
in the top of the file before
//= require_tree .
Upvotes: 1