ruby-on-rails – ‘罗盘观察’如何工作/如何与轨道一起使用
我做过罗盘创作.并在我的项目目录中指南针初始化轨道.几个问题:
>我已将.sass文件放在公共/样式表中.这是放置它们的正确位置吗? 提前谢谢了 编辑:解决了: >不,把它们放在app / stylesheets /中 解决方法
Compass使用位于“config / compass.rb”中的配置文件,该文件告诉它重要目录的位置.我认为它知道查看config / compass.rb,因为它搜索预定义目录列表中的compass.rb配置文件
下面是我用于Rails 3项目的配置文件 # This configuration file works with both the Compass command line tool and within Rails. # Require any additional compass plugins here. project_type = :rails project_path = Compass::AppIntegration::Rails.root # Set this to the root of your project when deployed: http_path = "/" css_dir = "public/stylesheets" sass_dir = "app/stylesheets" images_dir = "public/images" environment = Compass::AppIntegration::Rails.env # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true preferred_syntax = :sass 我通过从Rails根目录运行以下命令来生成此文件: compass init rails --css-dir=public/stylesheets --sass-dir=app/stylesheets --images-dir=public/images -x sass --using blueprint/basic 这是我用来运行指南针的唯一命令,我在通过rails模板https://github.com/sid137/rails-templates/blob/master/rails3.rb生成项目时运行它.我通过阅读指南针帮助,并在线查看,构建此命令,因为我想自定义我的所有指南针设置.现在,我可以立即开始我的项目 compass watch . 要么 compass compile . (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |