Module: Propagate::ClientHelper
- Defined in:
- lib/propagate/client_helper.rb
Instance Method Summary collapse
-
#propagate_tags(options = {}) ⇒ Object
Your public API can be specified in the
options
hash or preferably using the Configuration.
Instance Method Details
#propagate_tags(options = {}) ⇒ Object
Your public API can be specified in the options
hash or preferably using the Configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/propagate/client_helper.rb', line 5 def ( = {}) # Default options key = [:public_key] ||= Propagate.configuration.public_key raise PropagateError, "No public key specified." unless key error = [:error] ||= (defined? flash ? flash[:propagate_error] : "") uri = Propagate.configuration.api_server_url([:ssl]) html = "" html << %{<script type="text/javascript" src="#{uri}/site/#{key}/session/?} html << %{#{error ? "&error=#{CGI::escape(error)}" : ""}"></script>\n} return (html.respond_to?(:html_safe) && html.html_safe) || html end |