evfwcqcg
evfwcqcg

Reputation: 16335

Rails 3.2.3 load javascript from public folder before

Is there any way to load JavaScript from public folder before JavaScript-files from assets/javascript?

Upvotes: 3

Views: 4470

Answers (3)

Nitesh
Nitesh

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

Wawa Loo
Wawa Loo

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

Lisinge
Lisinge

Reputation: 2057

Sure. Just add

//= require_tree public

in the top of the file before

//= require_tree .

Upvotes: 1

Related Questions