Replies: 2 comments 9 replies
-
Hi @fakeharxy can you copy the full component class? |
Beta Was this translation helpful? Give feedback.
8 replies
-
I got here after receiving that error message about not being able to use before initialization. Found out it was because I was trying to access the URL helper within the component's |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, hope this is the right place for specific technical queries, let me know if not.
Second, obligatory "noob" disclaimer.
That out the way, I'm trying to use various rails helpers, most notably a path helper, within a component, whilst creating a second, internal component.
Example:
for instance.
This is hitting the "
#controller
cannot be used during initialization, as it depends on the view context that only exists once a ViewComponent is passed to the Rails render pipeline" error. Oddly it seems to work in the live environment (I think...) but not in my tests.Is there a way to use the path helpers within a component, or is it simply not possible with the way they are built? Does the question even make sense?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions