Search code examples
javascriptruby-on-rails-4amp-html

How does AMP-HTML page load javascript from rails/app/assets/javascript folder?


Before AMP I was using javascript_include_tag 'application' for including all js files but now after AMP implementation it shows error:

The tag 'script' is disallowed except in specific forms

AMP supports async attribute and application/json+ld type in script tag


Solution

  • As of 2017 you can use the amphtml gem with its javascript component to build strong rails applications with custom javascript.