与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类。我很想看到正确的解决方案。 –