afomera / trix

Easily drop the Trix WYSIWYG editor into your Ruby on Rails application.
MIT License
87 stars 29 forks source link

Webpacker support #6

Open kylefox opened 6 years ago

kylefox commented 6 years ago

It'd be nice to use this library with Webpacker in addition to the asset pipeline.

trnthanhtu commented 6 years ago

how could i use it together with webpacker? I'm looking the way to implement it.

kylefox commented 6 years ago

@trnthanhtu Unfortunately it's currently not supported by this gem. You'll need to do it manually if you require webpacker support — or better yet, submit a pull request 😉

acprsadmin commented 5 years ago

by manually you mean park the assets in vendor and not use the gem?

kylefox commented 5 years ago

@acprsadmin You could manually install Trix with yarn and then include it in your app/javascript/packs/application.js or whatever. This gem mainly provides form helpers, which will work regardless of how you install Trix's JS/CSS.

acprsadmin commented 5 years ago

Ok i parked trix.css in app/assets/stylesheets and trix.js in app/assets/javascripts

//= require trix in application.js @import "trix"; application.scss

I disabled the gem.

i get this error... couldn't find file 'trix/banner' with type 'application/javascript'

same thing if i use straight css links in header and script link in bottom of page

any ideas. is webpacker even worth the hassle in Rails 5.2.2?

acprsadmin commented 5 years ago

or should it use the trix.scss and trix coffee file under basecamp/trix/assets directly rather than the /dist directory.
what is diff between trix.js and trix-core.js???

acprsadmin commented 5 years ago

also what is the command to install trix with yarn?

thanks

kylefox commented 5 years ago

@acprsadmin I'm not sure why you're encountering those errors. Just to clarify, if you manually added the files to app/assets/stylesheets and app/assets/javascripts as you mentioned here, then you're using the asset pipeline — not webpacker.

This issue tracker is for bugs and feature requests relating to this gem specifically. If you're running into an issue installing the gem as described in the README, please open a new issue and describe the problem in as much detail as possible.

For other issues relating to Trix (including installation), please refer to the official Trix repo or post questions to Stack Overflow.