Require-js monly uses an attribute called "data-main" on the script tag. Is there a way to tell Rails' javascript tag helpers to add it, or should I just do it the old-fashioned way?
Require-js monly uses an attribute called "data-main" on the script tag. Is there a way to tell Rails' javascript tag helpers to add it, or should I just do it the old-fashioned way?
Share Improve this question asked May 1, 2011 at 23:19 egervariegervari 22.5k34 gold badges123 silver badges175 bronze badges1 Answer
Reset to default 12<%= javascript_include_tag 'application', :'data-main' => 42 %>
renders as :
<script data-main="42" src="/javascripts/application.js?1301333790" type="text/javascript"></script>