https://avo.cool logo
Join Discord
Powered by
# avo-2
  • l

    lemon-wall-20836

    02/08/2022, 6:49 PM
    got it
  • l

    lemon-wall-20836

    02/08/2022, 7:26 PM
    it will be present in the next release https://github.com/avo-hq/avo/issues/647
  • h

    helpful-microphone-19711

    02/08/2022, 8:02 PM
    Would it also be possible to customize the image that gets displayed when there are no results found? Personally I love the avocado, but I imagine some clients might not...haha!
  • l

    lemon-wall-20836

    02/08/2022, 8:11 PM
    You can already do that. Create a
    app/views/avo/partials/_empty_state.html.erb
    file in your app. Rails will pick it up and show it. Here's the original 👇 https://github.com/avo-hq/avo/blob/main/app/views/avo/partials/_empty_state.html.erb
  • h

    helpful-microphone-19711

    02/14/2022, 8:41 PM
    It looks like polymorphic belongs to fields aren't visible on index views. Is this intentional or perhaps a bug?
  • l

    lemon-wall-20836

    02/15/2022, 7:58 AM
    they should be visible @User
  • l

    lemon-wall-20836

    02/15/2022, 7:59 AM
    can you share your resource config in a GH issue? https://avo.cool/new-issue
  • s

    some-army-14041

    02/15/2022, 11:56 AM
    Hi there 🙂 Is there a way to show a create button for a
    has_one
    association? At the moment I just see an attach button...
  • l

    lemon-wall-20836

    02/15/2022, 11:57 AM
    Hmm, that's not supported right now. but I'll add it on the list to release in the next couple of days
  • l

    lemon-wall-20836

    02/15/2022, 11:58 AM
    a lot of those association features (polymorphic,STI, has-one create, plymorphic has many create) I didn't build because I didn't know if anyone was going to use it, so I went on the "build it when someone requests it" path
  • l

    lemon-wall-20836

    02/15/2022, 11:59 AM
    https://github.com/avo-hq/avo/issues/659
  • s

    some-army-14041

    02/15/2022, 12:05 PM
    Awesome thanks 💪
  • l

    lemon-wall-20836

    02/16/2022, 8:32 PM
    I added a few more examples in avodemo and
    Comment
    has a polymorphic
    BelongsTo
    association which is visible on index. https://avodemo.herokuapp.com/avo/resources/comments
  • l

    lemon-wall-20836

    02/16/2022, 8:33 PM
    but, I think I see what the problem is
  • h

    helpful-microphone-19711

    02/16/2022, 8:33 PM
    Appreciate it! There must be something weird with the configuration in my app. I was able to solve by just linking to the resource without using an association field.
  • l

    lemon-wall-20836

    02/16/2022, 8:34 PM
    I presume you are not on the index view for comments, but you see them on a has_many association?
  • l

    lemon-wall-20836

    02/16/2022, 8:34 PM
    can you confirm the above?
  • l

    lemon-wall-20836

    02/16/2022, 8:35 PM
    what I mean is on Index the association is there (https://avodemo.herokuapp.com/avo/resources/comments) when you see the comments as an association, the polymorphic has dissapeared (https://avodemo.herokuapp.com/avo/resources/posts/43)
  • h

    helpful-microphone-19711

    02/16/2022, 8:36 PM
    Ah, yes! This is it exactly! For my use case, the resource is only visible through associations - it's hidden in the sidebar.
  • l

    lemon-wall-20836

    02/16/2022, 8:38 PM
    got it
  • l

    lemon-wall-20836

    02/16/2022, 8:39 PM
    it was by design (but there's also a bug). so if a
    Post
    has many `Comment`s, when viewing one post, below on the page, in the comments list, you don't need to print the post column because it's going to be the same value (that posts title)
  • l

    lemon-wall-20836

    02/16/2022, 8:39 PM
    but somehow, the polymorphic association is hidden too. that's a bug
  • h

    helpful-microphone-19711

    02/16/2022, 8:40 PM
    Right - makes total sense!
  • l

    lemon-wall-20836

    02/16/2022, 8:42 PM
    https://github.com/avo-hq/avo/issues/668
  • c

    clean-salesmen-51708

    02/18/2022, 7:09 AM
    Heya Avo fam, I'm having an issue with Filters. For some reason the generated Filter is not showing.
  • l

    lemon-wall-20836

    02/18/2022, 8:50 AM
    Hey @User. Welcome! Can we get some more details? You generated it and added it to the resource? You're navigating to that resource index page and the filter is not showing?
  • c

    clean-salesmen-51708

    02/18/2022, 8:53 AM
    Correct, generated the the filter and navigated tot the resource and do not see the filter.
  • c

    clean-salesmen-51708

    02/18/2022, 8:53 AM
    Copy code
    class UserFilter < Avo::Filters::BooleanFilter
      self.name = "User filter"
    
      def apply(request, query, values)
        return query.where(admin: true) if value[:is_admin]
        query
      end
    
      def default
        {
          is_admin: false
        }
      end
    
      def options
        {
          is_admin: "Is Admin"
        }
      end
    end
  • l

    lemon-wall-20836

    02/18/2022, 8:53 AM
    can you paste the resource bit with the filter declaration?
  • c

    clean-salesmen-51708

    02/18/2022, 8:54 AM
    So that is what I'm missing.
1...262728...64Latest