-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Integration with Rails 5 Engines #562
Comments
I got it to work by updating the
by manually requiring the ...
require "react_on_rails/git_utils.rb"
module ReactOnRails
include GitUtils
module Generators
class InstallGenerator < Rails::Generators::Base
include GeneratorHelper
# fetch USAGE file for details generator description
source_root(File.expand_path("../", __FILE__))
... But still it doesn't feel like a right way to do. |
@abhinavmsra Thanks for researching this. It would be great if you can submit a documentation PR (and any associated code PR). |
@justin808 I still have some issues. Trying to fix them and then will share my git repo. |
@justin808 I still have issues with asset pipeline in particular the js, css from the react engine doesnt get loaded. Do you have some guides for that? |
@abhinavmsra We generally use webpack for all the js and css creation, and just create one file for each that gets used by the asset pipeline. |
Seeing this same issue. Manually requiring the module worked for the generator; but now I'm getting a failure in my
|
It appears that the above error is remedied by including the gem in the parent project; but then more errors ensue. Is there information anywhere on using this gem with engines? We're on Rails 4 and still experiencing this issue. The whole purpose of this engine is to be a pilot/sandbox/green pasture for React on Rails, so I don't want to touch the main project; but it's seeming like that is going to be unavoidable. |
I found this issue which relates to the errors I got after including the gem in the parent project. Adding the following:
to an initializer on the parent project allows the |
For anyone who stumbles upon this issue, I found a solution: In your engineAt the top of
In your
In your
In your
In the project including your enginePlace This is necessary because React on Rails attaches itself to the rake Requiring As far as solving the assets issue, |
Just in case it might be helpful I want to mention the wiki page that I created to gather all engine-related issues. |
@aCandidMind @noahprince22 Could either of you submit a PR with a doc page called rails-engines, placed in this directory: https://github.com/shakacode/react_on_rails/tree/master/docs/additional-reading and linked from the home page? |
CC: @Judahmeek |
@Judahmeek can we close this issue? |
As far as I'm concerned: yes. |
Hello, There is one slight problem with this approach - the file generated is inside gems public folder and then the application cannot find it - unless we modify somehow webpack paths. I've added simple copy to get the files into Rails.root public folder but not sure if this is a best approach |
I am trying to follow all this procedure but not able to start react within rails engine. Do you have any example where should I refer the changes. |
I am trying to integrate the gem in a Rails Engine, but for some reason it seems to fail giving the following error:
However I can integrate the gem in the core app without any errors. Only when i move the gem to the engine, I get the
GitUtils
error.For now my
.gemspec
file is rather simple and has dependencies defined as follows:Is there something that I am missing in the installation?
The text was updated successfully, but these errors were encountered: