Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to include javascript node_modules dependencies in Rails Engine?

Vaishnav Deore asked in Rails

I'm working on fork of simple_discussion gem which is Rails Engine to extend the functionality of forum in the parent Rails application.

I'm adding Markdown support using SimpleMDE. I've thought of one way to include it's minified js as assets in assets/javascripts/ folder so that this js will attached to its parent application.

Reply

Try creating a new JavaScript file in the assets/javascripts/ directory of your Rails app then copy the contents of the SimpleMDE JavaScript file into this new file.

Reply

<%= javascript_pack_tag 'simple_discussion/application' %>

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.