我有一個mixin,我想在一個Volt應用中包含幾個不同的類。相關的結構如下:在Volt框架中需要文件
包括文件路徑:app/component_1/models/my_model.rb
包含的文件路徑:app/component_2/mixins/my_mixin.rb
這是我已經試過:
require "#{Volt.root}/app/component_2/mixins/my_mixin"
產生這個錯誤在服務器輸出時加載一頁:SyntaxError: Cannot handle dynamic require
require "app/component_2/mixins/my_mixin"
當starti時產生此錯誤納克服務器:in `require': cannot load such file
require_relative "../../component_2/mixins/my_mixin"
在服務器輸出加載頁面時產生這個錯誤:Opal::Builder::MissingRequire: A file required by "app.rb" wasn't found. can't find file: "../../component_2/mixins/my_mixin"
require "./app/component_2/mixins/my_mixin"
債收益率這個錯誤在JavaScript控制檯中加載頁面時:Uncaught RuntimeError: no routes match path: /
不知道還有什麼嘗試?
使用Volt版本0.9.2 – neurodynamic