Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Commit 196f13b

Browse files
Shpigfordclaude
andcommitted
Add author dropdown fields to Avo resources
- Add searchable author dropdown to Article, Term, and FAQ Avo resources - Maintain existing authorship details in separate tabs - Enable easy author selection when editing content 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a19fe45 commit 196f13b

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/avo/resources/article.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def fields
1515
field :content, as: :easy_mde
1616
field :publish_at, as: :date_time
1717
field :author_name, as: :text, hide_on: [ :forms ]
18+
field :author, as: :belongs_to, searchable: true, display_with_value: -> { record.name }
1819

1920
tabs do
20-
tab "Author" do
21+
tab "Author Details" do
2122
field :authorship, as: :has_one
22-
field :author, as: :has_one, through: :authorship
2323
end
2424
end
2525
end

app/avo/resources/faq.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def fields
1414
field :answer, as: :easy_mde
1515
field :slug, as: :text
1616
field :category, as: :select, options: Faq::CATEGORIES
17+
field :author, as: :belongs_to, searchable: true, display_with_value: -> { record.name }
1718

1819
tabs do
19-
tab "Author" do
20+
tab "Author Details" do
2021
field :authorship, as: :has_one
21-
field :author, as: :has_one, through: :authorship
2222
end
2323
end
2424
end

app/avo/resources/term.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ def fields
1414
field :title, as: :text
1515
field :content, as: :easy_mde
1616
field :slug, as: :text
17+
field :author, as: :belongs_to, searchable: true, display_with_value: -> { record.name }
1718
field :video_id, as: :text
1819
field :video_description, as: :textarea
1920
field :video_upload_date, as: :date
2021
field :video_duration, as: :text
2122

2223
tabs do
23-
tab "Author" do
24+
tab "Author Details" do
2425
field :authorship, as: :has_one
25-
field :author, as: :has_one, through: :authorship
2626
end
2727
end
2828
end

0 commit comments

Comments
 (0)