Hello I am building a custom resource
# avo-2
b
Hello, I am building a custom resource tool, and I am attempting to use the Avo Panel Component within a partial. I can successfully render the partial, however, when attepting to use TurboStream to append another instance of the partial I am getting an error
Copy code
Error performing Turbo::Streams::ActionBroadcastJob (Job ID: 194f3864-5724-4428-a444-90e7ead4d330) from Async(default) in 8.99ms: ActionView::Template::Error (undefined method `white_panel_classes' for #<ActionView::Base:0x000000000102e8>):
l
that is a rails helpers. when use din view components you should prepend them with
helper
eg:
helpers.white_panel_classes
b
here's my partial
Copy code
<%= render Avo::PanelComponent
    .new(
        name: "#{new_message.created_by_id}", 
        description: "#{new_message.created_at}"
    ) do |c| 
%>
    <% c.with_body do %>
        <div class="flex flex-col p-4 min-h-24">
            <div class="space-y-4">
                <h3><%= new_message.body %></h3>

                <p>Style: shiny</p>
              </div>
        </div>
    <% end %>
<% end %>
l
Or delegate them like we do
delegate :white_panel_classes, to: :helpers
l
that should just work
can you please create a reproduction repo so we can test it?
b
Yea no problem! Dumb question, though... that would just entail creating a GitHub issue with all the relevant code snippets?
l
nope
please create an app we can clone and test
*and there are no dumb questions
the simplest way to create a new Avo app is
rails new test_app
and inside that dir run
bin/rails app:template LOCATION='https://avohq.io/app-template'
b
ok thanks!
@lemon-wall-20836 any chance since you're already a member of my github repo that would give you access to investigate this? If not I'll create the dummy repo, but there's a bit of work involved there so figured I would check real quick since we had set you up with access to review our app for Avo3...
l
in my experience setting up a new repo is more valuable for both parties, especially for us as we need a quick way to get started (bundle, yarn, rail serve)
already existing projects usually have credentials, custom settings and we waste a ton of time setting those up
b
yea makes sense thanks 👍
l
thank you! we appreciate the help
b
yea of course...there's a fair amount going on with this feature....think I'll isolate the turbostream stuff cus that's where my hunch is it's happening
2 Views