Skip to content

Commit 01aa54f

Browse files
maebealeclaude
andcommitted
Add windows type dropdown to workshop variation edit form
Adds a WindowsType select dropdown next to the variation name field and permits windows_type_id in the controller's strong params. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bd30d65 commit 01aa54f

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

app/controllers/workshop_variations_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def set_form_variables
111111
def workshop_variation_params
112112
params.require(:workshop_variation).permit(
113113
[ :name, :rhino_body, :published, :publicly_visible, :position, :youtube_url, :created_by_id,
114-
:organization_id, :workshop_id, :workshop_variation_idea_id, :author_credit_preference
114+
:organization_id, :workshop_id, :workshop_variation_idea_id, :author_credit_preference,
115+
:windows_type_id
115116
]
116117
)
117118
end

app/views/workshop_variations/_form.html.erb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,20 @@
4949
<!-- Variation fields -->
5050
<div class="grid grid-cols-1 md:grid-cols-1 gap-6">
5151
<div>
52-
<%= f.input :name, label: "Variation name", input_html: { class: "w-full" } %>
52+
<div class="flex flex-col md:flex-row md:space-x-4 mb-4">
53+
<div class="flex-1">
54+
<%= f.input :name, label: "Variation name", input_html: { class: "w-full" } %>
55+
</div>
56+
<div class="w-full md:w-1/3">
57+
<%= f.input :windows_type_id,
58+
as: :select,
59+
collection: WindowsType.all,
60+
label_method: :short_name,
61+
value_method: :id,
62+
include_blank: "Select type",
63+
label: "Windows type" %>
64+
</div>
65+
</div>
5366

5467
<div class="form-group <%= 'has-error' if f.object.errors[:rhino_body].present? %>">
5568
<%= rhino_editor(f, :body) %>

0 commit comments

Comments
 (0)