Skip to content

Instantly share code, notes, and snippets.

@ayamomiji
Created December 4, 2013 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayamomiji/7790970 to your computer and use it in GitHub Desktop.
Save ayamomiji/7790970 to your computer and use it in GitHub Desktop.
use slim in sprockets
class CustomSlimEngine < Slim::Template
def evaluate(scope, locals, &block)
scope.class_eval do
include Rails.application.routes.url_helpers
include Rails.application.routes.mounted_helpers
include ActionView::Helpers
end
super
end
end
Rails.application.assets.register_engine('.slim', CustomSlimEngine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment