Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying javascripts is disabled #180

Open
jacobtjackson opened this issue Oct 7, 2020 · 4 comments
Open

Copying javascripts is disabled #180

jacobtjackson opened this issue Oct 7, 2020 · 4 comments

Comments

@jacobtjackson
Copy link

Hi, I'm trying to use commontator with a Rails 5.2 app that uses webpacker for javascript deployment. I tried importing the necessary javascripts going off of the readme, but didn't have much success. I then noticed that you can copy most of the gem into your project using rails commontator:copy:<item_to_copy/>. This worked great for the stylesheets, but it doesn't seem to have an option for copying the javascript files; when I run rails --tasks the list of commontator-related tasks looks like this:

rails commontator:copy                   # Copy assets, views, mailers, helpers, controllers and models from commontator to application
rails commontator:copy:controllers       # Copy controllers from commontator to application
rails commontator:copy:helpers           # Copy helpers from commontator to application
rails commontator:copy:images            # Copy images from commontator to application
rails commontator:copy:locales           # Copy locales from commontator to application
rails commontator:copy:mailers           # Copy mailers from commontator to application
rails commontator:copy:models            # Copy models from commontator to application
rails commontator:copy:stylesheets       # Copy stylesheets from commontator to application
rails commontator:copy:views             # Copy views from commontator to application
rails commontator:install                # Copy initializers and migrations from commontator to application
rails commontator:install:initializers   # Copy initializers from commontator to application
rails commontator:install:migrations     # Copy migrations from commontator to application 

Is there another way I can easily copy the Javascript files without having to do it manually?

@alaarab
Copy link

alaarab commented Oct 7, 2020

what about rake commontator:copy:javascripts (as per the documentation)

@jacobtjackson
Copy link
Author

jacobtjackson commented Oct 8, 2020

@alaarab Right, I tried that and got an error that basically said that command isn't defined (I'm paraphrasing here because I don't remember exactly what the error was, but that error was what prompted me to check the list of available tasks in the first place).

If you look at the file where the tasks are defined you will see that javascripts is no longer one of the available tasks so it must have been taken out at some point? Either way the documentation should be updated at the very least.

@inspire22
Copy link

Did you end up figuring out how to copy out the javascripts? Looking into using this with import maps and rails 7 and figure it might need some tweaks like this.

@jacobtjackson
Copy link
Author

Did you end up figuring out how to copy out the javascripts? Looking into using this with import maps and rails 7 and figure it might need some tweaks like this.

I didn't, I ended up giving up and using "acts_as_commentable" instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants