Call Component class from a html file #28
-
Hi, I created
I am getting this error
How should I call my component from a html file? Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should be able to include Phlex components like this. <%= NavComponent.new.call.html_safe %> But it looks like your |
Beta Was this translation helpful? Give feedback.
You should be able to include Phlex components like this.
But it looks like your
NavComponent
hasn't even been loaded. If you put theNavComponent
inapp/components/nav_component.rb
it should be loaded automatically. I’d like to create a helper method for Rails so you can include them with just<%= component NavComponent %>
. This should be part of #1.