Fields feedback #834
Replies: 3 comments 13 replies
-
Hi, I am trying to create a field that will automatically generate a default value off another form field input value. Does the default block have access to other form values on create (values that have not been saved to the record)? |
Beta Was this translation helpful? Give feedback.
-
I added a field and it doesn't show up in the index or show view: class Avo::Resources::Talk < Avo::BaseResource
def fields
field :speakers, as: :has_many
end
end This is my model: class Talk < ApplicationRecord
has_many :talk_speakers
has_many :speakers, through: :talk_speakers, source: :user
end Question 1: what do I have to do to make it show up in the show view (not the index view)? |
Beta Was this translation helpful? Give feedback.
-
Here's another issue where I'm a bit stumped that it doesn't work, and there's no error message and no log output. class Avo::Resources::Ticket < Avo::BaseResource
def fields
field :item_name, as: :select, options: -> { record.item_names }, filterable: true
end
end class Ticket < ApplicationRecord
def self.ransackable_attributes(auth_object = nil) = %w(item_name)
def item_names
raise
end
end The "Filters" button does not appear and nothing is raised, i.e. the |
Beta Was this translation helpful? Give feedback.
-
Let's use this space to provide feedback for anything field-related.
Post an issue if something is broken.
Beta Was this translation helpful? Give feedback.
All reactions