2
我需要使用我的屬性,由於我有一個javascript框架問題雙引號,我已經嘗試設置Haml的:: Template.options哈希作爲文檔使用Rails時建議,但是不會影響「資產」文件夾,無論我在哪裏設置選項。請注意,它正在由Rails的控制器所呈現正常模板的ActionView,但不是在模板中我有{Rails.root}/app/assets/javascripts/templates/*.html.haml
選項傳遞到鏈輪發動機
下,這是我在{Rails.root}/config/initializers/haml.rb
:
Haml::Template.options[:attr_wrapper] = '"'
# Adds the ability to use HAML templates in the asset pipeline for use with
# Batman.js partials
Rails.application.assets.register_mime_type 'text/html', '.html'
Rails.application.assets.register_engine '.haml', Tilt::HamlTemplate
我也試圖改變register_engine
使用Haml::Engine
和,這兩個都呈現,但仍然沒有采取我上面設置的選項。
如何在資產管道中設置用於渲染的Haml選項?似乎我需要傳遞Sprocket引擎的選項?