Add DirectiveProcessor to postprocessors #265

cutalion opened this Issue Dec 17, 2011 · 3 comments


None yet

3 participants


Is it possible to add DirectiveProcessor to the end of processors chain?
It could be useful in case you want to add some conditional assests.
See, for instance, that question on the StackOverflow - Exclude certain assets from pipeline in development environment?

Just, curious. Of course, there still an option to include different files in the layout.

josh commented Dec 17, 2011

The answer is yes, but if this is what you are trying to do:

<% if Rails.env.production? %>
//= require google_analytics_snippet
<% end %>

try this instead:

<% if Rails.env.production?
  require_asset "google_analytics_snippet"
end %>
@josh josh closed this Dec 17, 2011

Cool, thanks!

marcusg commented May 27, 2013

Is there also a way to include a tree using a condition? I searched through the code and only found the require_asset method.

@marcusg marcusg referenced this issue in activeadmin/activeadmin Jun 17, 2013

Support for select2 plugin #2267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment