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

    microscopic-dream-82397

    04/19/2023, 11:04 PM
    Hey guys! Now one with Devise. I must have forgotten to configure something. I created the User model inside a namespace, something like app/models/access/user.rb. Authentication works great, the e-mail of user appears at the bottom of Avo interface, but the link to end the session is simply gone. Does anyone know what I forgot to configure?
    l
    • 2
    • 14
  • f

    flat-sugar-59156

    04/20/2023, 7:09 PM
    Does anyone know if you can pass parameters into dashboard cards?
    l
    • 2
    • 10
  • l

    little-psychiatrist-30020

    04/21/2023, 12:48 PM
    Quick question, how can I add a time_zone set from the model into an avo field? eg this works
    field :starts_at, as: :date_time, hide_on: [:new], visible: -> (resource:) { resource.model.time_zone.present? }
    l
    • 2
    • 27
  • l

    little-psychiatrist-30020

    04/21/2023, 12:49 PM
    but this does not
    field :starts_at, as: :date_time, hide_on: [:new], timezone: -> (resource:) { resource.model.time_zone }
  • l

    little-psychiatrist-30020

    04/21/2023, 12:50 PM
    I would like to do both.
  • e

    early-knife-34520

    04/24/2023, 10:18 AM
    avo_edit_field
    doesn't display validation errors for nested fields. Are there ways to fix this other than writing own rails form?
    l
    • 2
    • 1
  • b

    bumpy-tent-43389

    04/24/2023, 1:36 PM
    Hello to all. I wanted to try (again) Avo, following the Bookr tutorial and ... I must have done something wrong: the main content is not displaying, though it was working when I tried for the very first time. I tried cleaning cache, re-generating the project, even rebooting. In the "Inspector", there is really nothing. What am I missing? 🤔
    l
    • 2
    • 15
  • b

    big-sunset-95620

    04/24/2023, 6:00 PM
    hi all! I am using acts as taggable on in my models. I used @Adrian from Avo 's script on rails bytes, and all went well on my machine. I pushed it up to my staging server, and while the tags can be entered, they do not save to the model I am saving. Any ideas?
    l
    l
    • 3
    • 4
  • d

    dazzling-author-18914

    04/25/2023, 6:32 PM
    i am trying to use this in a model - the arvo generator is grokking on it - attribute :assessed_by, :reference, references: :user # User or team responsible for performing the assessment
    l
    • 2
    • 31
  • d

    dazzling-author-18914

    04/25/2023, 6:33 PM
    /Users/rafaqatali/.gem/ruby/3.2.2/gems/activerecord-7.0.4.3/lib/active_record/type/adapter_specific_registry.rb:36:in `lookup': Unknown type :reference (ArgumentError) raise ArgumentError, "Unknown type #{symbol.inspect}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • d

    dazzling-author-18914

    04/25/2023, 6:33 PM
    would anyone have any ideas how to get past this issue?
  • f

    fancy-crowd-87619

    04/27/2023, 6:46 PM
    I'm using Pundit - and want to disable the ability to attach, detach, and create associated records for almost every one of my tables. As a result, all of my policies are absolutely full of:
    Copy code
    def attach_user? = false
    def detach_user? = false
    def create_user? = false
    Anyone know a nice way to make all of these relationship abilities
    false
    by default?
    l
    • 2
    • 20
  • HasMany in the List view
    b

    better-restaurant-41251

    04/30/2023, 7:20 PM
    Is there a way to show a
    HasMany
    or
    HasAndBelongsToMany
    association in the `List`/`Index` view? In my case, I'd like to show a comma-delimited list of the titles of the associated resources.
    l
    • 2
    • 3
  • i

    incalculable-psychiatrist-85460

    05/01/2023, 10:57 PM
    My Index view on a VenueResource is not displaying any of the records. - defining the model class hasn't helped - changing the query on index - resource does appear on the sidebar -
    generate avo:resource venue
    didn't auto-populate the fields - I'm running it under an admin authentication. no need for pundit policies (default is installed). I did this on another rails app with no issues. **Edit**: I added a navigation count label, and it correctly shows the number of records. Just no display. - I'm using Tailwind + HAML **Edit 2**: Switching to ERB didn't fix the issue. 😦
    l
    • 2
    • 5
  • i

    incalculable-psychiatrist-85460

    05/01/2023, 10:57 PM
    Any suggestions on what docs to look at?
  • b

    billowy-easter-81499

    05/02/2023, 4:28 AM
    Hello, I have been attempting to use the new encode_filter_params but have not been able to get it to work following the documentation. I can successfully encode to Base64, but the URL is not prepending with “…filters=…” It’s simply encoding the params and appending it to the URL which Avo is unable to interpret. Also, it appears the only way to pass params via URLs for now is using the filters correct? This is an elegant approach but appears tightly integrated requiring a lot of extra steps for simply passing some data from one view to another, etc… This
    Copy code
    redirect_to avo.resources_communities_path Avo::Filters::BaseFilter.encode_filters({"ClientFilter"=>models[0].id})
    Produces
    Copy code
    http://localhost:3000/crm/resources/communities.eyJwYXJhbXMiOnt9fQ==%0A
    While I believe for this whole thing to work it needs to produce this
    Copy code
    localhost:3000/crm/resources/communities?page=1&filters=eyJDbGllbnRGaWx0ZXIiOjQwMDExfQ==%0A
    Am I not encoding it properly? Is there another, easier, way to pass data via URLs I am missing? Thanks!
    l
    w
    • 3
    • 30
  • m

    microscopic-dream-82397

    05/02/2023, 2:23 PM
    Hey guys. While on the screen for inserting or editing records, it is possible to hide and display a field dynamically while filling in the data, type: - Hide a field 2 if field 1 has a certain amount of characters? - And the opposite too, redisplay field 2 if field one has a certain amount of characters?
    l
    • 2
    • 8
  • b

    big-sunset-95620

    05/02/2023, 5:42 PM
    I must be doing something wrong. I added a field:
  • b

    big-sunset-95620

    05/02/2023, 5:42 PM
    Copy code
    class EventResource < Avo::BaseResource
      self.title = :id
      self.includes = []
      # self.search_query = -> do
      #   scope.ransack(id_eq: params[:q], m: "or").result(distinct: false)
      # end
    
      field :id, as: :id
      # Fields generated from the model
      field :happening_on, as: :date_time
      field :title, as: :text
      field :place, as: :text
      field :more_info_link, as: :text
      # add fields here
      field :youtube_unique_id, as: :text
    
    end
  • b

    big-sunset-95620

    05/02/2023, 5:43 PM
    rails generate migration AddYoutubeUniqueIdToEvents youtube_unique_id:text
  • b

    big-sunset-95620

    05/02/2023, 5:45 PM
    it doesn't save
    l
    • 2
    • 3
  • b

    big-sunset-95620

    05/02/2023, 5:46 PM
    I can save in the repl.
  • q

    quaint-pencil-2979

    05/02/2023, 9:48 PM
    Hello guys!! I am facing a strange behavior, i dont know if is a bug or miss configuration, i have try a lot of things.
    Copy code
    ruby
    class User < ApplicationRecord
      has_one :consumer, dependent: :destroy
      has_one :power_plant, through: :consumer
    end
    
    
    class Consumer < ApplicationRecord
      belongs_to :user
      belongs_to :power_plant, optional: true
    end
    
    
    class PowerPlant < ApplicationRecord
      has_many :consumers, dependent: :nullify
    end
    When i try to detach a power_plant from user in avo destroy the model consumer too, like:
    User.first.power_plant=nil
    destroy consumer.
    User.first.power_plant.destroy!
    works, destroy only de power_plant.
    l
    • 2
    • 7
  • g

    great-optician-87198

    05/05/2023, 8:45 AM
    Hello before opening an issue I wanted to see if someone has the same behavior. My global search is working perfectly and searching in all various resources BUT my resource search always returns nothing. I tested the API route manually
    Copy code
    http://admin.lvh.me:3000/avo/avo_api/search?q=a&global=false
    and it also returns an empty json
    l
    • 2
    • 16
  • b

    billowy-easter-81499

    05/05/2023, 5:57 PM
    I am trying to follow the Nested-Records-When-Creating guide (https://docs.avohq.io/2.0/recipes/nested-records-when-creating.html) and notice it deviates from the demo code in a few different places. I am able to inject the custom js via jsbunlding/esbuild abd create the required partials, but my form isn't adding the nested records correctly. Has anyone else successfully implemented this feature?
    l
    • 2
    • 2
  • m

    microscopic-dream-82397

    05/05/2023, 11:34 PM
    Hey guys. I again. When I use ransack inside AVO with the "field_cont: params[:q]" parameter, I should use PostgreSQL LIKE, but AVO always uses ILIKE, as if it had used the "field_i_cont: params[:q]" configuration, with the vowel "i" before "_cont". Would anyone know how to switch to using LIKE?
    l
    • 2
    • 6
  • a

    able-needle-51274

    05/08/2023, 7:36 PM
    Me again 😬 We have stimulus controllers for country/province/city select boxes that work on local but not on our staging environment. I have verified on staging that our license key is working and active. Not sure what else to check?
    l
    • 2
    • 21
  • f

    fresh-thailand-89388

    05/09/2023, 12:39 PM
    Hey all, have been looking through the source code of avo, and can't figure out at what point is a resource instantiated?
    Copy code
    app/controllers/avo/application_controller.rb:120
    
        def set_resource
          raise ActionController::RoutingError.new "No route matches" if resource.nil?
    
          @resource = resource.hydrate(params: params)
        end
    I think this should be the point, but if we look at how
    def resource
    is defined - it should return a
    class
    while
    #hydrate
    is an instance method on
    BaseResource
    l
    • 2
    • 53
  • c

    cool-hamburger-19730

    05/09/2023, 1:01 PM
    Hello everyone, I'm new here! Trying to build my app with avo 2.31. I'm digging through documentation now and building things I need, but I'm confused with mobile interface. This is how it looks from my mobile phone. I thought Avo has mobile interface straight from the box? But it doesn't look mobile oriented. Maybe I should configure it somehow and I missed it?
    l
    • 2
    • 14
  • n

    nice-ambulance-76519

    05/10/2023, 4:58 PM
    Hi everyone, I'm working on an action on a model that uses the prefixed_id gems. The model looks like that:
    Copy code
    class Quiz < ApplicationRecord
      has_prefix_id :q, minimum_length: 6
    
      belongs_to :blog
      belongs_to :operation
      has_many :questions
      has_many :answers, through: :questions
      has_and_belongs_to_many :email_accounts
      has_one_attached :rules
    .....
    
    end
    The action is not yet implemented and I'm just using to learn how it works before I can create a real one:
    Copy code
    class CopyQuiz < Avo::BaseAction
      self.name = "Make a copy"
    
      def handle(**args)
        models, fields, current_user, resource = args.values_at(:models, :fields, :current_user, :resource)
    
        binding.pry
      end
    end
    When I run the action, I get the following error that's shown in the screenshot. If I remove the has_prefixed_ids it works fine. Does any of you know if this is a problem on the avo side or on the prefixed_ids gem?
    l
    • 2
    • 2
1...575859...64Latest