> > I wonder if I am missing a better way. The rails guide (and stackoverflow) > suggests that I should be able to include assets from an engine using the > require tag in my application.css but I wasn't able to get that to work. > Not a big deal now. I am just curious. >
This works in development, because the server is configured to serve static assets (config.serve_static_assets = true), so the request for the engine asset (communityengine.css) goes through the Rails stack. In production, it doesn't by default, so those assets will not be accessible unless you precompile them explicitly. Even better, just throw them into your application.css (which *is* precompiled by default). So, in application.css, do: /* *= require communityengine */ > > One problem that I haven't yet resolved: i have my own version of > layout.html.haml and have overridden several of the shared partials. In > production the first page load blows up with > > ActionView::Template::Error (layout.css isn't precompiled): > 1: = stylesheet_link_tag 'layout' > 2: = stylesheet_link_tag 'application' > 3: > 4: - if forum_page? > Again, unless you explicitly tell Rails to precompile layout.css, it won't be available in production. So either add it to the list of assets to precompile, or just include in application.css, as above. Generally speaking, you want to include one stylesheet and one javascript file (if possible) per page load (or at least the fewest number possible). So in your case, I'd have an application.css file which I link in the layout.html.haml template. Then, in that application.css, you might have something like: /* *= require communityengine *= require layout */ That way, the CE styles are loaded first, and you can then override them. If I copy shared/_scripts_and_styles into my app and comment out the line > that includes layout.css, everything works but, of course, I lose the > styling. I have tried every permutation of creating my own layout.css, > adding layout to config.assets.precompile. > > I'm not asking anyone to research this for me but if I'm missing something > obvious, please speak up :-) > > Thanks for the encouragement and the great engine. It will save me a ton > of time and I hope I'll eventually be able to contribute something back. > > Kevin > > > On Wednesday, December 19, 2012 11:56:19 AM UTC-8, Bruno wrote: >> >> >> Good luck! >> Bruno >> >> -- > You received this message because you are subscribed to the Google Groups > "CommunityEngine" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/communityengine/-/khjIN-lN8cwJ. > > To post to this group, send email to communityengine@googlegroups.com. > To unsubscribe from this group, send email to > communityengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/communityengine?hl=en. > -- You received this message because you are subscribed to the Google Groups "CommunityEngine" group. To post to this group, send email to communityengine@googlegroups.com. To unsubscribe from this group, send email to communityengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/communityengine?hl=en.