Skip to content

Instantly share code, notes, and snippets.

@costa
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save costa/32496c17cb77b03cea8a to your computer and use it in GitHub Desktop.

Select an option

Save costa/32496c17cb77b03cea8a to your computer and use it in GitHub Desktop.
Rails: loading asynchronous Pusher client-side (js) module: in app/views/layouts/application.html.haml
- if defined? PusherFake
= javascript_tag File.read Dir.glob(File.expand_path 'features/support/application/public/javascripts/vendor/pusher-2.*.js', Bundler.load.specs.find{|s| s.name == 'pusher-fake' }.full_gem_path).last
- else # NOTE Since Pusher is not really useful with no internet connection... let's CDN it
%script{:src => "http://js.pusher.com/2.0/pusher.min.js", :defer => true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment