Skip to content

Instantly share code, notes, and snippets.

@danmartens
Created August 13, 2014 16:36
Show Gist options
  • Save danmartens/e28e4be471f697dd829e to your computer and use it in GitHub Desktop.
Save danmartens/e28e4be471f697dd829e to your computer and use it in GitHub Desktop.
Rails Livereload Helper
module LivereloadHelper
def livereload_script_tag
ip = Socket.ip_address_list.detect { |intf| intf.ipv4_private? }
ip ? content_tag(:script, nil, src: "http://#{ip.ip_address}:35729/livereload.js?snipver=1") : ''
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment