Module: Sprockets::Helpers::RailsHelper

Defined in:
lib/viewtalitarian.rb

Instance Method Summary collapse

Instance Method Details

#javascript_include_tag_with_constraints(*sources) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/viewtalitarian.rb', line 13

def javascript_include_tag_with_constraints(*sources)
  if sources.length > 1 && Rails.env.development?
    raise Viewtalitarian::NoScriptsForYou.new(
      "You've attempted to include more than one JavaScript file. " +
      "Perhaps you should create a manifest instead?"
    )
  end

  javascript_include_tag_without_constraints(*sources)
end