Skip to content

Commit

Permalink
Enable speaker_tags for Talk resource (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Aug 20, 2024
1 parent 0fc479e commit 1b4ea6a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions app/avo/resources/talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,9 @@ def fields
field :title, as: :text, link_to_record: true
field :event, as: :belongs_to

# This is broken on the latest Avo version: undefined method `use_resource' for an instance of Avo::Fields::TextField
# avo (3.11.7) app/controllers/avo/application_controller.rb:90:in `related_resource'

# field :speakers, as: :tags, hide_on: [:show, :forms] do
# record.speakers.map(&:name)
# end

# field :speakers, as: :text, hide_on: [:show, :forms], use_resource: "Avo::Resources::Speaker" do
# record.speakers.map(&:name)
# end
field :speaker_tags, for_attribute: :speakers, name: "Speakers", through: :speaker_talks, as: :tags, hide_on: [:show, :forms] do
record.speakers.map(&:name)
end

field :topics, as: :tags, hide_on: [:index, :forms] do
record.topics.map(&:name)
Expand Down

0 comments on commit 1b4ea6a

Please sign in to comment.