microscopic-dream-82397
04/19/2023, 11:04 PMflat-sugar-59156
04/20/2023, 7:09 PMlittle-psychiatrist-30020
04/21/2023, 12:48 PMfield :starts_at, as: :date_time, hide_on: [:new], visible: -> (resource:) { resource.model.time_zone.present? }
little-psychiatrist-30020
04/21/2023, 12:49 PMfield :starts_at, as: :date_time, hide_on: [:new], timezone: -> (resource:) { resource.model.time_zone }
little-psychiatrist-30020
04/21/2023, 12:50 PMearly-knife-34520
04/24/2023, 10:18 AMavo_edit_field
doesn't display validation errors for nested fields. Are there ways to fix this other than writing own rails form?bumpy-tent-43389
04/24/2023, 1:36 PMbig-sunset-95620
04/24/2023, 6:00 PMdazzling-author-18914
04/25/2023, 6:32 PMdazzling-author-18914
04/25/2023, 6:33 PMdazzling-author-18914
04/25/2023, 6:33 PMfancy-crowd-87619
04/27/2023, 6:46 PMdef 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?better-restaurant-41251
04/30/2023, 7:20 PMHasMany
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.incalculable-psychiatrist-85460
05/01/2023, 10:57 PMgenerate 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. 😦incalculable-psychiatrist-85460
05/01/2023, 10:57 PMbillowy-easter-81499
05/02/2023, 4:28 AMredirect_to avo.resources_communities_path Avo::Filters::BaseFilter.encode_filters({"ClientFilter"=>models[0].id})
Produces
http://localhost:3000/crm/resources/communities.eyJwYXJhbXMiOnt9fQ==%0A
While I believe for this whole thing to work it needs to produce this
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!microscopic-dream-82397
05/02/2023, 2:23 PMbig-sunset-95620
05/02/2023, 5:42 PMbig-sunset-95620
05/02/2023, 5:42 PMclass 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
big-sunset-95620
05/02/2023, 5:43 PMrails generate migration AddYoutubeUniqueIdToEvents youtube_unique_id:text
big-sunset-95620
05/02/2023, 5:45 PMbig-sunset-95620
05/02/2023, 5:46 PMquaint-pencil-2979
05/02/2023, 9:48 PMruby
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.great-optician-87198
05/05/2023, 8:45 AMhttp://admin.lvh.me:3000/avo/avo_api/search?q=a&global=false
and it also returns an empty jsonbillowy-easter-81499
05/05/2023, 5:57 PMmicroscopic-dream-82397
05/05/2023, 11:34 PMable-needle-51274
05/08/2023, 7:36 PMfresh-thailand-89388
05/09/2023, 12:39 PMapp/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
cool-hamburger-19730
05/09/2023, 1:01 PMnice-ambulance-76519
05/10/2023, 4:58 PMclass 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:
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?