Adding this to the gem's copy of [CE gem]/lib/community_engine/
engine.rb:
# Enabling assets precompiling under rails 3.1
if Rails.version >= '3.1'
initializer :assets do |config|
Rails.application.config.assets.precompile +=
%w( community_engine.js )
end
end
..and then running this in my app's root dir:
$bundle exec rake assets:precompile
..generated the desired community_engine.js file, concatenating and
compressing these resources specified in [CE gem]/app/assets/
javascripts/community_engine.js:
//= require prototype
//= require rails
//= require effects
//= require builder
//= require dragdrop
//= require controls
//= require lightbox
//= require prototip-min
Editing a gem like that certainly isn't ok, so it might be time to
learn how to fork and submit a pull request.
However, this code change shouldn't be necessary. From the docs:
"7 Adding Assets to Your Gems
Assets can also come from external sources in the form of gems.
A good example of this is the jquery-rails gem which comes with Rails
as the standard JavaScript library gem. This gem contains an engine
class which inherits from Rails::Engine. By doing this, Rails is
informed that the directory for this gem may contain assets and the
app/assets, lib/assets and vendor/assets directories of this engine
are added to the search path of Sprockets."
http://guides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems
The existence of [CE gem]/lib/community_engine/engine.rb (which does
inherit form Rails::Engine) should be enough to add CE's asset dirs to
Sprocket's search path.
Any suggestions?
thx!
Mike
On Dec 6, 6:09 pm, d00n <[email protected]> wrote:
> Hello all,
>
> Anybody using the asset pipeline in rails 3.1? How did you get CE to
> play nice?
>
> I'm about to try this approach, and will report
> back:http://thomas.vondeyen.com/2011/11/09/precompile-assets-from-rails-3-...
>
> thx!
> Mike
--
You received this message because you are subscribed to the Google Groups
"CommunityEngine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/communityengine?hl=en.