You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for what appears to be an excellent gem (we're just starting with it) which is properly documented (huge plus)!
For context: Our admin backend is an engine living in a separate subfolder. After using the install generator react_on_rails:install I had to do several things to configure react_on_rails to use the backend subfolder instead of RAILS_ROOT.
I must admit, I'm not 100% sure whether things wouldn't be all along smoother for react_on_rails and other gems if we were to add them to the Gemfile of the backend subfolder instead of to the one in RAILS_ROOT. But I haven't had time to figure this out yet.
Running the install generator inside of the subfolder doesn't work for us, because then a lot of other relative paths would need to be adjusted. Currently we're running tasks, generators, etc. from RAILS_ROOT.
Here's what I had to do:
Delete the created app/assets/javascripts/application.js file and move the one new line in it to the appropriate file in the backend subfolder.
Move the hello world controller and view to the backend subfolder.
Change output.path in client/webpack.config.js to include that subfolder.
Change the assets initializer path
Change config.generated_assets_dir in the react_on_rails initializer.
Move the hello world route from the routes file in RAILS_ROOT to the one in the backend subfolder.
Change ignore path in .gitignore
Change cleanup path in Procfile.dev
This isn't important stuff, the things that need to be changed are still reasonable, but a target option changing essentially the root directory for the generator accelerates startup and might prevent initial debugging of what's not working.
The text was updated successfully, but these errors were encountered:
@aCandidMind It would be awesome to get a sample repo of using React on Rails as an engine, with some doc additions. If you'd like to create a PR to set the target directory for the generator, please chat with @jbhatab as he's maintaining the generator.
@aCandidMind I'm working on the component generator for now but this might be a nice feature to add. Do you think you could make a PR for this by adding an option of the target folder? I'm up to talk things out if you ever get a chance.
First of all thanks for what appears to be an excellent gem (we're just starting with it) which is properly documented (huge plus)!
For context: Our admin backend is an engine living in a separate subfolder. After using the install generator
react_on_rails:install
I had to do several things to configure react_on_rails to use thebackend
subfolder instead of RAILS_ROOT.I must admit, I'm not 100% sure whether things wouldn't be all along smoother for react_on_rails and other gems if we were to add them to the Gemfile of the
backend
subfolder instead of to the one in RAILS_ROOT. But I haven't had time to figure this out yet.Running the install generator inside of the subfolder doesn't work for us, because then a lot of other relative paths would need to be adjusted. Currently we're running tasks, generators, etc. from RAILS_ROOT.
Here's what I had to do:
app/assets/javascripts/application.js
file and move the one new line in it to the appropriate file in the backend subfolder.output.path
inclient/webpack.config.js
to include that subfolder.config.generated_assets_dir
in the react_on_rails initializer.This isn't important stuff, the things that need to be changed are still reasonable, but a target option changing essentially the root directory for the generator accelerates startup and might prevent initial debugging of what's not working.
The text was updated successfully, but these errors were encountered: