與Dojo一起工作很愉快。在我的項目中,我已經在vendor/assets/javascripts中複製了Dojo的組件(我有文件夾dojo,dojox和dijit)。在我的appilcation.html.haml中:
= stylesheet_link_tag "application"
= csrf_meta_tags
/More ideas for your <head> here: h5bp.com/d/head-Tips
/
All JavaScript at the bottom, except this Modernizr build incl. Respond.js
Respond is a polyfill for min/max-width media queries. Modernizr enables HTML5 elements & feature detects;
for optimal performance, create your own custom Modernizr build: www.modernizr.com/download/
= javascript_include_tag "modernizr"
= javascript_include_tag "dojo/dojo", :'data-dojo-config' => %Q(baseUrl: '/assets/dojo/', modulePaths: {modules: '/assets/modules', widgets: '/assets/widgets', parseOnLoad: true})
%body
它工作正常,它太棒了。
編輯:我很有興趣研究如何在資產管道中使用Dojo。我找到了一個interesting post關於在正確的地方包括Dojo的來源 - app/assets/javascript。
我知道你基本上繞過了我得到的資產管道。我真正關心的是dojo的開發,除了使用基礎的dojo類。在教程(http://dojotoolkit.org/documentation/tutorials/1.8/modules/),用於顯影模塊他們推薦的結構: / 的index.html JS/ LIB/ 道場/ 的dijit/ DojoX中/ my/ util/ 那麼如何將它融入到RoR目錄結構中,並且這兩種環境都可以很好地發揮作用。 –
你是對的,我正在使用基礎Dojo類。我很想看到正確的解決方案。 –