Module: ActionView::Helpers::AssetTagHelper

Defined in:
lib/neighborparrot/helpers/url_helpers.rb

Constant Summary collapse

NEIGHBORPARROT_JS_API =
'/js/parrot.js'
NEIGHBORPARROT_JS_DUMMY_API =
'/js/dummy-parrot.js'

Instance Method Summary collapse

Instance Method Details

#neighborparrot_include_tagObject

URL helper for the parrot js client If :dummy_tests is true, use a dummy parrot avoiding connections with the server but triggering onconnect



12
13
14
15
16
17
# File 'lib/neighborparrot/helpers/url_helpers.rb', line 12

def neighborparrot_include_tag
  config = Neighborparrot.configuration
  parrot_js = config[:dummy_connections] ? NEIGHBORPARROT_JS_DUMMY_API : NEIGHBORPARROT_JS_API
  src = "#{config[:assets_server]}#{parrot_js}"
  (:script, nil, { :type => 'text/javascript', :src => src })
end