ruby on rails - can I serve assets from inside of a gem -



ruby on rails - can I serve assets from inside of a gem -

i bundle mutual assets css, js, , icon images gem personal use.

can utilize assets within of gem directly, or have have generator move them main app?

what need is:

make railtie:

module mygemname module rails class engine < ::rails::engine end end end

put them in directory otherwise proper asset path, lib/assets/stylesheets.

use sprockets include javascripts:

//= require "foobar"

use sass include stylesheets:

@import "foobar";

use sass function image-url if refer images within stylesheets:

.widget { background-image: image-url("widget-icon.png"); }

the assets directory should behave same if within own application.

you can find illustration in formalize-rails, has stylesheets, javascripts , images.

ruby-on-rails ruby-on-rails-3 asset-pipeline

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -