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

    straight-mechanic-78430

    10/22/2022, 10:32 AM
    Hi guys:) I don't know if this is possible to do with Avo, and before investing in any changes I hope someone can help. Please comment if you can point me to the right direction. I have an STI model animal , birds and mammal are inheriting animal. Is it possible to bind the resource of each record to the resource Bird or Mammal in this case, instead of animal ? the behaviour right now, AVO will use the animal resource for all record in the list
    l
    q
    • 3
    • 35
  • l

    lemon-wall-20836

    10/22/2022, 11:31 AM
    STI
  • s

    straight-mechanic-78430

    10/25/2022, 9:03 AM
    we are reverting right now to 2.17 since we encouter issues with the new Release : ```ruby NameError - uninitialized constant Avo::Services::AuthorizationClients::PunditClient::Pundit Pundit.policy(user, record) ^^^^^^:
  • l

    lemon-wall-20836

    10/25/2022, 9:03 AM
    https://docs.avohq.io/2.0/upgrade.html#upgrade-from-2-17-to-2-18
  • l

    lemon-wall-20836

    10/25/2022, 9:03 AM
    please read the update guide
  • l

    lemon-wall-20836

    10/25/2022, 9:04 AM
    โš ๏ธ Guys, when you're upgrading to version 2.18, please add the following gems to your
    Gemfile
    Copy code
    ruby
    # Minimal authorization through OO design and pure Ruby classes
    gem "pundit"
    
    # Active Storage makes it simple to upload and reference files
    gem "activestorage"
    
    # High-level image processing wrapper for libvips and ImageMagick/GraphicsMagick
    gem "image_processing"
    
    # All sorts of useful information about every country packaged as convenient little country objects.
    gem "countries"
    
    # Create beautiful JavaScript charts with one line of Ruby
    gem "chartkick"
  • l

    lemon-wall-20836

    10/25/2022, 9:05 AM
    Also, when upgrading, always check the upgrade guide ๐Ÿ˜… We keep detailed reports here on what (if needed) you should do for the upgrade. https://docs.avohq.io/2.0/upgrade.html
  • s

    straight-mechanic-78430

    10/25/2022, 9:07 AM
    thanks Adrian, I will keep an eye on it ๐Ÿง
  • m

    mammoth-guitar-49791

    10/25/2022, 10:33 AM
    I have a :point data type in my rails model and I would like to edit it using Avo. I have it set as :text at the moment and it prints
    #<struct ActiveRecord::Point x=0.0, y=0.0>
    What data type would be appropriate here?
  • m

    mammoth-guitar-49791

    10/25/2022, 10:50 AM
    Copy code
    ruby
      field :location_x, as: :text do |model|
        model.location.x
      end
      field :location_y, as: :text do |model|
        model.location.y
      end
    I'm using something like this and it shows up in the show view but not in the edit.
  • q

    quiet-winter-98496

    10/25/2022, 11:02 AM
    Because you're using a block to get the value, it will be read-only - that makes it a computed value (with this code, avo cannot know how to save the value of the text input back to your model)
  • l

    lemon-wall-20836

    10/25/2022, 11:03 AM
    Thatโ€™s correct๐Ÿ‘†
  • l

    lemon-wall-20836

    10/25/2022, 11:03 AM
    The way to get around this is to add a getter and setter to the model
  • l

    lemon-wall-20836

    10/25/2022, 11:05 AM
    like
    Copy code
    ruby
    def location_x_something
      location.x
    end
    def location_x_something=(value)
      location.x = value
    end
    
    field :location_x_something, as: :text
  • l

    lemon-wall-20836

    10/25/2022, 11:07 AM
    now Avo will treat it like a regular attrigute on the model
  • m

    mammoth-guitar-49791

    10/25/2022, 11:09 AM
  • m

    mammoth-guitar-49791

    10/25/2022, 11:09 AM
    https://gist.github.com/jmarsh24/f0822b5443254942199900d42f0862cc
  • l

    lemon-wall-20836

    10/25/2022, 11:10 AM
    the getters and setters should be on the model
  • m

    mammoth-guitar-49791

    10/25/2022, 11:11 AM
    ๐Ÿ‘Œ Thank you
  • l

    lemon-wall-20836

    10/25/2022, 11:19 AM
    anytime man!
  • q

    quiet-winter-98496

    10/25/2022, 11:27 AM
    Does anyone know of a way to set a different resource title in search results? I often have resources with the same title. In an index view I can show other fields to make it obvious which one you're looking at, but in search results all you can see is the title
    l
    • 2
    • 29
  • s

    straight-mechanic-78430

    10/25/2022, 4:39 PM
    Does anyone has similar Problem with the new release ? fileds in action forms are not rendererd as input fields @lemon-wall-20836 should I create a bug issue ? or do u have any hint where to pre debug the problem thanks
    l
    • 2
    • 27
  • s

    straight-mechanic-78430

    10/25/2022, 4:40 PM
    its happening only in 2.18 , 2.17 is OK
  • r

    ripe-article-50191

    10/25/2022, 5:41 PM
    Hi everybody. After create a simple dashboard with one metric for a model, on loading the metric appears as the image, and I get the next error on console:
    Unpermitted parameters: :turbo_frame, :range, :locale. Context: { controller: Avo::HomeController, action: failed_to_load,
    Any idea?
    l
    • 2
    • 20
  • r

    ripe-article-50191

    10/26/2022, 9:46 AM
    Dashboard charts issue
  • s

    straight-mechanic-78430

    10/26/2022, 11:19 AM
    Hi Avo peple ๐Ÿ™‚ How do we set max hight for a codemirror input field ? any quick field options ? or do we have set some css styles directly pas html: ? apreciate anys suggestion cu
    l
    • 2
    • 2
  • m

    melodic-army-3498

    10/26/2022, 11:36 AM
    Hi! I'm dabbling with Avo and I'm wondering how to make certain fields not editable. Setting
    readonly: true
    on a field level only deactivates the field on the client side. I can still manipulate the request and persist changes to the field. I'd like to be able to control the permitted parameters in the controllers. Can I do this?
    l
    • 2
    • 13
  • q

    quiet-winter-98496

    10/26/2022, 4:00 PM
    Has anyone else had trouble getting tailwind to compile new css classes when you're working on a custom field? When I add a new tailwind class to my html in a custom field, it never styles it correctly and I think it's because it's not recompiling css? Is there something I missed in the documentation maybe? Another task to run?
    l
    • 2
    • 19
  • l

    lemon-wall-20836

    10/26/2022, 9:26 PM
    Has anyone else had trouble getting
  • l

    lemon-wall-20836

    10/26/2022, 9:29 PM
    Hi Avo peple ๐Ÿ™‚
1...484950...64Latest