Skip to content

Instantly share code, notes, and snippets.

@sbellity
Last active December 19, 2015 17:29
Show Gist options
  • Save sbellity/5991564 to your computer and use it in GitHub Desktop.
Save sbellity/5991564 to your computer and use it in GitHub Desktop.
hull-rails initializer
require 'handlebars_assets'
Hull.configure do |config|
# == Hull App Config
#
config.app_id = ENV["HULL_APP_ID"]
# == Hull App secret
# This is required to enable all server side secure stuff.
#
config.app_secret = ENV["HULL_APP_SECRET"]
# == Hull Org Url
config.org_url = ENV["HULL_ORG_URL"]
# == Authenticate Users
config.authenticate_users = false
# == Curent user name
# The method/variable that contains the logged in user in your controllers.
# If it is `current_user` or `@user`, then you can ignore this
# config.current_user = Proc.new { current_user }
# == User Custom Data
# A hash of additional data you wish to send about your users.
# You can provide either a method name which will be sent to the current
# user object, or a Proc which will be passed the current user.
# config.user_attributes = {
# :image => :image,
# :email => :email,
# :name => Proc.new { |current_user| current_user.name.try(:upcase) }
# }
# == hull.js version
config.js_url = "https://d3f5pyioow99x0.cloudfront.net/0.5.2/hull.js"
HandlebarsAssets::Config.path_prefix = 'hull_components'
end
<html>
<head>
</head>
<body>
...
<script src="https://d3f5pyioow99x0.cloudfront.net/0.5.2/hull.js"></script>
<script src="/assets/hull_components.js"></script>
<script>
Hull.init({"appId":"xxx","orgUrl":"https://xxx.hullapp.io","widgets":{"sources":{"default":"/assets/hull_components"}}});
</script>
</body>
</html>
@natedrouin
Copy link

        <div data-hull-id='app' data-hull-widget='comments@hull'></div>

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