miniature-optician-85831
04/02/2024, 10:20 PMminiature-optician-85831
04/06/2024, 9:54 PMminiature-optician-85831
04/12/2024, 1:39 PMswift-businessperson-84139
04/25/2024, 3:53 AMruby
field(:name, as: :text, name: 'Full Name', link_to_record: true, filterable: true, sortable: true)
field(
:email,
as: :text,
protocol: :mailto,
filterable: true,
sortable: true,
visible: lambda {
current_user.management? || current_user.board_member? || current_user == resource.record.user
}
)
field(
:phone,
as: :text,
protocol: :tel,
filterable: true,
sortable: true,
visible: lambda {
current_user.management? || current_user.board_member? || current_user == resource.record.user
}
)
field(
:tags,
as: :tags,
filterable: true,
sortable: true,
help: 'Press comma to enter more than one tag. Tags with multiple words are allowed.'
)
The table is broken with the above fields; please look at the image.
https://cdn.discordapp.com/attachments/1141725718364045394/1232902291657461871/Screenshot_2024-04-24_at_11.49.09_PM.png?ex=662b253c&is=6629d3bc&hm=aed39532b412e0fb47926f7edf0fa7f523e1712974f450d5d51ddb1f00faa6c6&modern-ambulance-83380
04/25/2024, 2:20 PMenfore_suggestions: true
without pre-filling them when creating a new record?
i have a lot of options to choose from but the user should only select a few. with the current setup, the user has to delete all of the suggestions first before he can select the tags wanted.
thats my field:
ruby
field :disciplines,
as: :tags,
delimiters: [","],
suggestions: -> { record&.disciplines&.present? ? record&.disciplines : [] },
enforce_suggestions: true
future-garden-51299
04/26/2024, 4:05 PMgeometry
argument to the area
field type based on whether the geojson is multipolygon or polygon. It appears that field specific options are static...purple-park-97233
04/28/2024, 5:49 PMfield :soundtrack1, as: :file, is_image: false, display_filename: false
calm-gold-48525
05/02/2024, 1:02 AMswift-businessperson-84139
05/17/2024, 6:43 PMswift-businessperson-84139
05/18/2024, 10:49 PMruby
def fields
field(:name, as: :text)
field(:icon, as: :select, options: -> { helpers.icons_for_select })
field(:color, as: :text) # color picker???
end
I wonder if there is a way to use icon: "heroicons/outline/eye"
with a list of icons, as Avo does in a few places (maybe color too).
Has anyone tried it before? Thanks in advance.rough-student-26326
05/25/2024, 7:07 PMhas_one
or a belongs_to
field for something like this?purple-park-97233
06/25/2024, 1:36 PMimport { Controller } from '@hotwired/stimulus'
export default class extends Controller {
static values = {
view: String,
}
static targets = ["typeSelectInput", "marriagedateDateWrapper", "marriagedateDateInput"];
async connect() {
console.log('view ->', this.viewValue)
}
typeChanged() {
console.log('type was changed');
let value = this.typeSelectInputTarget.value;
if (value == "Spouse") {
console.log('Selected SPOUSE');
this.marriagedateDateInputTarget. // Activate field here
}
}
}
wooden-musician-16187
07/03/2024, 8:38 AMpurple-analyst-91381
07/03/2024, 1:55 PMbroad-helmet-78129
07/03/2024, 8:07 PM:belongs_to
, but I'd like to display a field that is more meaningful than the object id (namely the :description
field of the associated resource)purple-park-97233
08/18/2024, 6:36 PMpurple-park-97233
08/19/2024, 9:00 PMattach_fields
, is there anything special I need to add to my model or controller somewhere?
I have the following "Company" field:
tab "Companies" do
field :companies, as: :has_many, through: :coaster_companyables,
attach_scope: -> { query.order(name: :asc) },
searchable: true,
show_on: :edit,
linkable: true,
attach_fields: -> {
field :role, as: :text
}
# field :companyables, as: :has_many
end
And when i try to attach a company and type a Role in, I just get Avo stating "Failed to attach Company".
No errors in the log, just this line:
rocessing by Avo::AssociationsController#create as TURBO_STREAM
20:58:39 web.1 | Parameters: {"authenticity_token"=>"[FILTERED]", "fields"=>{"related_id"=>"intamin-amusements", "role"=>"trains"}, "button"=>"", "view"=>"show", "resource_name"=>"attractions", "id"=>"this-one-at-this-place", "related_name"=>"companies"}
Just wondered if i'm missing something before I spin up a demo app.boundless-printer-62821
08/20/2024, 3:58 PMpurple-park-97233
09/14/2024, 10:33 AMpurple-park-97233
10/04/2024, 4:07 PMbelongs_to
and not `select`s.
I'd appreciate a bit of help with getting this up and running and i've been scrabbling for days on this. Sighmammoth-guitar-49791
10/08/2024, 10:22 AM:has_one
relationship suppose to trigger scope? In the documentation has_many relationships are not suppose to trigger a scope through association, only index.
https://docs.avohq.io/3.0/authorization.html#associations
shouldn't the behavior be the same for has_one?
https://cdn.discordapp.com/attachments/1141725718364045394/1293156682368553021/image.png?ex=67065982&is=67050802&hm=d5a4c19377850d3d5062d60621351eb65357d62470933929e67ef0029a10374e&helpful-waitress-4127
12/16/2024, 6:53 PMclass Avo::Resources::Listing < Avo::BaseResource
# self.includes = []
# self.attachments = []
self.search = {
query: -> { query.ransack(name_cont: params[:q], description_cont: params[:q], m: "or").result(distinct: false) }
}
self.title = :description
def fields
field :id, as: :id
field :name, as: :text
field :occ_macro_major, as: :belongs_to, searchable: true
field :occ_field_of_study, as: :belongs_to, searchable: true
end
end
class OccMacroMajor < ApplicationRecord
has_many :occ_field_of_studies, inverse_of: :occ_macro_major, dependent: :destroy
has_many :listings, inverse_of: :occ_macro_major
end
class OccFieldOfStudy < ApplicationRecord
belongs_to :occ_macro_major, inverse_of: :occ_field_of_studies
has_many :listings, inverse_of: :occ_field_of_study
end
able-needle-51274
12/17/2024, 8:36 PMhelpful-waitress-4127
12/18/2024, 10:39 PMminiature-optician-85831
01/14/2025, 10:20 PMminiature-optician-85831
01/14/2025, 10:52 PMquaint-pencil-2979
02/07/2025, 1:36 PMdef fields
field :id, as: :id
field :name, as: :text, name: "Nome", required: true
field :email, as: :text, required: true
field :password, as: :password, only: [:new, :edit]
field :role, as: :select, enum: ::User.roles, name: "Acesso a plataforma", default: "super_admin", readonly: true
end
straight-pager-31449
02/17/2025, 8:14 AMfield :foo, as: :has_many, scope: -> {
query.limit(3) # limit does not work
}
has_many :foo, -> { limit 3 } # limit does not work
calm-gold-48525
03/15/2025, 1:35 AMpurple-park-97233
03/25/2025, 8:44 PMaction Avo::Actions::MakeMainPhotoFor,
arguments: -> do
{
attractions: record.attractions.pluck(:id)
}
end
but in the fields method I try to output that and I get the id of a record from a totally different class.
Any ideas?