Rails:从 sprocket 迁移到 webpacker

时间:2021-08-01 22:54:03

标签: ruby-on-rails webpack ruby-on-rails-6

嗨,我在将我的应用程序从使用链轮的 rails 5 迁移到使用 webpacker 的 rails 6 时遇到了困难。我正在使用我的代码中看到的全局变量,但我已经阅读了带有 webpacker 的 rails 6 不喜欢这个。

root.html.erb

#!/usr/bin/env python

    if __name__ == '__main__':    
    
        a = "-32750"  # value received via serial from the arduino, at a given time.
        b = "32760"   # value received via serial from the arduino, at a given time.
    
        result = int(a) - int(b)        
        print("Result: "+str(result))

我想知道您实施了哪些解决方案来与 webpacker 更兼容。谢谢

0 个答案:

没有答案