[英]Install rails assets in a ruby gem
I am transforming a ruby plugin to a ruby gem. 我正在将ruby插件转换为ruby gem。 In the plugin I was able to run 在插件中,我能够运行
rake gem_name:install
This would install javascript and images into the rails assets directory. 这会将javascript和图像安装到rails资产目录中。 Can I automate this, so when i include the gem in mijn gemfile, this is all included automatically? 我可以自动执行此操作,因此当我在mijn gemfile中包含gem时,这些都会自动包含在内吗?
What is the way of doing this? 这样做的方法是什么?
You don't need install your styles and scripts into the rails app in rails 3.1 and 3.2. 您不需要将样式和脚本安装到rails 3.1和3.2中的rails应用程序中。
Just put them into app/assets
, lib/assets
or vendor/assets
; 只需将它们放入app/assets
, lib/assets
或vendor/assets
; and add Rails::Engine
class to you gem (it can be empty). 并将Rails::Engine
类添加到gem(它可以为空)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.