Working in rails 8 (uninitialized constant) #914
-
|
I cannot for the life of me get Phlex working in an existing Rails 8 application. As a simple test, I created a I then try calling it in my I've also tried defining it as Every time I get an error like What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The component and the render call look correct but if you ran the install script and have a Phlex initializer file, it would expect to find that class under Can you confirm the If you can paste the exact error, that might help identify the issue. I assume it's a Zeitwerk error. |
Beta Was this translation helpful? Give feedback.
-
|
Ahh! The file name was the missing piece. Renaming it to Yep, I ran the install script. Thanks for that! I could not for the life of me figure out what was wrong. |
Beta Was this translation helpful? Give feedback.
The component and the render call look correct but if you ran the install script and have a Phlex initializer file, it would expect to find that class under
app/components/hello.rb.Can you confirm the
phlex.rbinitializer was generated when you ranrails generate phlex:install?If you can paste the exact error, that might help identify the issue. I assume it's a Zeitwerk error.