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

    lemon-wall-20836

    07/07/2022, 3:55 PM
    I started a PR to catch this error more gracefully and not crash the app
  • l

    loud-jewelry-99127

    07/11/2022, 1:53 PM
    Hello, after updating to v2.10.2 this error apear in some resources index
  • l

    loud-jewelry-99127

    07/11/2022, 1:53 PM
  • l

    loud-jewelry-99127

    07/11/2022, 1:54 PM
    I can't understand what is wrong, if i undo the version update everything works just fine
  • l

    loud-jewelry-99127

    07/11/2022, 1:54 PM
    " missing required keys: [:id] " but the id is there :S
  • l

    loud-jewelry-99127

    07/11/2022, 2:40 PM
    Issue Opened: https://github.com/avo-hq/avo/issues/1040
  • g

    green-london-56146

    07/11/2022, 2:59 PM
    just form the screenshot: it looks odd that resource_name is a whole object
  • l

    lemon-wall-20836

    07/11/2022, 3:03 PM
    yes. we after a bit of troubleshooting we figured it's hitting a different route than expected. it's hitting the records re-ordering route instead of the regular resource route.
  • l

    lemon-wall-20836

    07/11/2022, 3:04 PM
    this manifests itself only with the
    order
    resource
  • f

    faint-belgium-54046

    07/12/2022, 5:04 PM
    Anyone used this? https://docs.avohq.io/2.0/resources.html#records-ordering
  • s

    some-army-14041

    07/13/2022, 6:28 AM
    Yes. We are using it for a lot of our resources...
  • GitHub - stefankroesancestry Organise ...
    s

    some-army-14041

    07/13/2022, 6:36 AM
    Is anyone using the ancestry (https://github.com/stefankroes/ancestry) gem and want to share some experiences with me? It seems that viewing a "child" is always opening the parent again...
    l
    s
    +3
    • 6
    • 21
  • l

    lemon-wall-20836

    07/13/2022, 8:09 AM
    GitHub - stefankroesancestry Organise ...
  • b

    bright-tomato-27372

    07/14/2022, 6:36 AM
    Has anyone worked with
    has_many_through
    associations where the JOINs table has extra fields to display? For example, let's say there's
    Recipe
    ,
    Ingredient
    , and
    RecipeIngredients
    to JOIN the two tables.
    Copy code
    class Recipe
      has_many :recipe_ingredients
      has_many :ingredients, through: :recipe_ingredients
    end
    
    class Ingredient
      has_many :recipe_ingredients
      has_many :recipes, through: :recipe_ingredients
    end
    
    class RecipeIngredient < ApplicationRecord
      belongs_to :recipe
      belongs_to :ingredient
      # also has a 'quantity' attribute to show the quantity of the ingredients in the recipe
    end
    In my
    recipe_resource.rb
    , I have
    field :ingredients, as: :has_many, through: :recipe_ingredients
    . The #show page shows the details for the
    Ingredient
    , but I also want to show the
    ingredient.quantity
    after the
    Ingredient
    fields. I'm probably missing something small and silly, but how can I show the quantity from
    RecipeIngredient
    on the
    Recipe#show
    page? And make the quantity editable from the
    Recipe#edit
    ?
    l
    • 2
    • 9
  • l

    lemon-wall-20836

    07/14/2022, 8:19 AM
    has_many through attributes
  • b

    bright-tomato-27372

    07/15/2022, 5:58 AM
    What's the best way to access
    current_user
    inside of a Avo resource file? Reason is I'm saving a resource that
    belongs_to
    a User and needs a
    user_id
    (the id of the currently signed in user). I'm attempting something like this:
    field :user_id, as: :hidden, default: @current_user.id
    inside of the resource. Would it need to be set in the
    ApplicationController
    ?
    l
    • 2
    • 7
  • e

    early-camera-94059

    07/16/2022, 12:24 PM
    Hi, I'm working on setting up Avo. We use dry-rails that uses dry-schema to allow schemas to be defined as an alternative to strong_parameters. I am finding that to load
    /avo
    it is failing to find the
    schema
    method used to define schemas. This is not a problem loading other controllers. Any ideas why Avo might hit this issue?
    l
    • 2
    • 2
  • l

    lemon-wall-20836

    07/16/2022, 2:39 PM
    dry-rails & dry-schema
  • e

    early-camera-94059

    07/16/2022, 4:38 PM
    Is it possible to override the component that renders the profile photo? I think the code assumes its an Active Storage record if present, but we have a custom Photo model so Avo tries to render
    /avo/photos/123
    which doesnt work.
    l
    • 2
    • 2
  • l

    lemon-wall-20836

    07/16/2022, 8:26 PM
    Customize profile photo
  • e

    early-camera-94059

    07/17/2022, 9:07 AM
    I'm struggling to get lists of associated records to show. If in the initializer
    config.authorization_methods
    is defined to add an
    avo_
    prefix to each policy method, does the same get applied to the
    attach_{association}?
    methods?
    l
    • 2
    • 3
  • e

    early-camera-94059

    07/18/2022, 9:43 AM
    Is there any way to do bulk attach for has_many relationships? If not currently, has that been considered for future?
    l
    • 2
    • 3
  • l

    lemon-wall-20836

    07/18/2022, 9:53 AM
    Is there any way to do bulk attach for
  • f

    faint-belgium-54046

    07/18/2022, 4:07 PM
    Hello guys, i created a tool but i cant use paths inside them.
    l
    • 2
    • 2
  • f

    faint-belgium-54046

    07/18/2022, 4:07 PM
  • f

    faint-belgium-54046

    07/18/2022, 4:07 PM
    anyone had this error? am i missing something?
  • s

    some-army-14041

    07/19/2022, 1:41 PM
    Hi, Is there already a way to search within has_many entries or is that only possible via text-filters atm?
    l
    • 2
    • 10
  • l

    lemon-wall-20836

    07/19/2022, 4:01 PM
    Hi
  • w

    worried-machine-9922

    07/19/2022, 4:06 PM
    I'm trying to make an action that duplicates a record. I've got this action:
    Copy code
    class DuplicateRecord < Avo::BaseAction
      self.name = "Duplicate record"
      def handle(**args)
        models, resource = args.values_at(:models, :resource)
        model = models.first
        redirect_to resource.avo.new_resources_prediction_path(duplicate_of_id: model.id)
        silent
      end
    end
    And this here concern I'm including in relevant `Avo::ResourcesController`s.
    Copy code
    module Avo::Duplicable
      def new
        super
        if params[:duplicate_of_id]
          @model = Prediction.find(params[:duplicate_of_id]).dup
          @resource = @resource.hydrate(model: @model, view: :new, user: _current_user)
        end
      end
    end
    The problem is the point in the Action where you're `redirect_to`'d
    avo.new_resources_predictions_path
    ,
    Prediction
    being a model in my app. I am looking for a way to generate the appropriate path for any arbitrary resource. I have tried
    avo.polymorphic_path
    but that points me at
    prediction_path
    , which does not exist, and is not appropriate for the
    new
    action anyway. tl;dr: Given an arbitrary Avo resource or AR model, I would like to have a way to call
    new_resourses_RESOURCENAME_path
    appropriate for the resource or model.
    l
    • 2
    • 8
  • n

    narrow-laptop-54609

    07/19/2022, 6:45 PM
    Is there any way to change the plural resource title to singular? I have a model named "Feedback" and showing it as "Feedbacks" does not make sense, is there a configuration setting I missed in the docs?
1...434445...64Latest