Custom asset directory #18

Closed
aantix opened this Issue Jan 18, 2014 · 3 comments

2 participants

@aantix

I created a custom asset directory (lib/assets).

I added it to the rails asset paths in my application.rb.

config.assets.paths << "#{Rails.root}/lib/"

I have a class in that custom asset directory (users.js.rb).

This asset does not get included (users.js.rb) when serving up my pages.

It does get included when the asset is located in app/assets/javascripts.

Any idea as to why my user.js.rb class in my custom asset directory isn't being included?

@elia
Opal member

Sadly yes, I think it's related to the fix to this rails issue: rails/rails#7587

To fix it I forced the cache of paths that need eager loading, here:
https://github.com/opal/opal-rails/blob/master/lib/opal/rails/engine.rb#L13-L15

A temporary solution is probably to use config.before_initialize as I do here:
https://github.com/opal/opal-rails/blob/master/lib/opal/rails/engine.rb#L17-L19

@elia
Opal member

Is this still an issue?

@elia
Opal member

I'll close assuming it's not an issue anymore. Feel free to reopen/ping me if there's anything I can do.

@elia elia closed this May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment