开发者

How can I use Ruby/Rails variables inside Sass?

开发者 https://www.devze.com 2023-04-10 10:12 出处:网络
Is there a way to use vari开发者_运维知识库ables from my Ruby application inside a Sass file?You can add .erb extention to your .sass file and then add your variables just like in regular .erb file:

Is there a way to use vari开发者_运维知识库ables from my Ruby application inside a Sass file?


You can add .erb extention to your .sass file and then add your variables just like in regular .erb file:

<%= APP_CONFIG[:yourkey] %>

More information:

  • http://guides.rubyonrails.org/asset_pipeline.html#preprocessing
  • http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
  • http://rwilcox.tumblr.com/post/9038701675/sass-variables-and-the-rails-3-1-asset-pipeline
0

精彩评论

暂无评论...
验证码 换一张
取 消