These are chat archives for opal/opal

Aug 2016
Mitch VanDuyn
Aug 01 2016 16:32
I have a file "foo.rb.erb". The erb values that need to be expanded are normally all set in an initializer . All works great, except I am trying to write some server side tests, that will go through various configuration options. The problem is once the foo.rb.erb is expanded to foo.rb I can't get it to "reexpand" during the testing.... I have tried setting the rails cache to null_cache, deleteting cache/tmp/* etc, etc...
note that the file being expanded is inside a gem... perhaps that makes a difference?
Jamie Gaskins
Aug 01 2016 17:23
@CicholGricenchos You should be able to run it with Opal.load('application') in JS after your <script> tag that loads the app via Sprockets. If you load it via Opal::Sprockets.javascript_include_tag 'application', it should inject that automatically, but if you use the raw Sprockets-compiled JS, it won't add that line in.