jwhitley / requirejs-rails

RequireJS support for your Rails 3 or 4 application
MIT License
592 stars 202 forks source link

requirejs_include_tag "page1" does not generate <script data-main="/assets/page1.js"… #207

Open Bill opened 9 years ago

Bill commented 9 years ago

The README says:

requirejs_include_tag "page1"

will generate:

<script data-main="/assets/page1.js"…

But it does not. It actually generates this:

<script>require.config({"baseUrl":"/assets",…"waitSeconds":15}); require(["page1"]);</script>

and this:

<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="page1" src="/assets/page1.js"></script>
carsomyr commented 9 years ago

@Bill Thanks for bringing this up, and yes, I do agree that the documentation is a bit obtuse.

Bill commented 9 years ago

@carsomyr what prevented me from attempting an actual fix was that when I looked at what is currently generated in the DOM, it was not clear to me what the intention was vis-à-vis the behavior documented in README.md.

I don't know whether the right fix is to change the documentation to match the current behavior, Or to change the behavior to match the documentation?