Skip to content

Instantly share code, notes, and snippets.

@jimsynz
Created December 17, 2014 20:33
Show Gist options
  • Select an option

  • Save jimsynz/9b8f8d05823aec6576fd to your computer and use it in GitHub Desktop.

Select an option

Save jimsynz/9b8f8d05823aec6576fd to your computer and use it in GitHub Desktop.
module AssetsHelper
def inline_asset name
Rails.application.assets.find_asset(name).source
end
end
Rails.application.assets.context_class.class_eval do
include AssetsHelper
end
scope = {}
(-> `<%= inline_asset 'messagerocket/channel' %>`).call(scope)
Channel = scope.Channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment