General questions

Bower + Rails + Myscript-Text-Web

Hi,

All week I've been trying to get the myscript-text-web module working on my Rails 4.2.6 application, but Rails breaks when trying to import the "myscript-text-web.html" file because there's no way to add HTML to the asset pipeline.

I tried the 'bower-rails' gem and the 'bower' gem, both with and without installing bower directly from npm.

I tried emcee for its html_import_tag, but it breaks as it's no longer under development. Same situation for sprockets-htmlimports

I tried avoiding bower altogether by using rails-assets, but all the dependencies wouldn't work with bundler.

I tried moving my components directory to vendor/bower_components, /bower_components, app/assets/components and public/components trying to get around the pipeline.

Finally, I tried adding AngularJS for its templating.

I need to add this tool to my enterprise application for Stanford but I need some more direction at this point. 

I'm not using npm, bower,  angularjs, or any of the other tools I've listed for anything else in my application, so it would be great if there were another way. Or any way at all.

Kamille

(please send help)


Dear Kamille,

thank you for contacting us.

Can you please try the following code, which should answer your needs (replace YOUR_KEY with your own application key and YOUR_HMAC_KEY with your hmac key).

<html>
<head>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js"></script>
  <link rel="import" href="https://cdn.rawgit.com/MyScript/myscript-math-web/12aedcb7/docs/components/myscript-math-web/myscript-math-web.html">
</head>
<body>
  <myscript-math-web  applicationkey="YOUR_KEY" hmackey="YOUR_HMAC_KEY">
  </myscript-math-web>
</body>
</html>


Let us know if this helps.

Best regards,

Olivier

Hey Olivier,

Thanks for helping me out with this, the CDN is working perfectly!
Is there a link I can use for myscript-text-web (versus the math-web CDN link you had provided)?

Kamille

Hi Kamille,

You can use this markup for myscript-text-web.

 

<html>
<head>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js"></script> 
  <link rel="import" href="https://cdn.rawgit.com/MyScript/myscript-text-web/76608ced/myscript-text-web.html">
</head>
<body>
  <myscript-text-web  applicationkey="YOUR_KEY" hmackey="YOUR_HMAC_KEY">
  </myscript-text-web>
</body>
</html>

 Regards,

Pierre-Alban


Login or Signup to post a comment