Skip to content

Commit acd06a5

Browse files
maebealeclaude
andcommitted
Add data-action to all collection controller forms
The collection controller was refactored to use data-action instead of addEventListener, but only video_recordings was updated. All 17 other forms using the collection controller were missing the action attributes, breaking search/filter auto-submit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 55e3050 commit acd06a5

17 files changed

Lines changed: 19 additions & 12 deletions

File tree

app/views/bookmarks/_search_boxes.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<%= form_with url: url,
22
method: :get,
33
data: { controller: "collection",
4+
action: "change->collection#handleChange input->collection#handleInput",
45
turbo_frame: frame_id },
56
autocomplete: "off",
67
class: "space-y-4" do |f| %>

app/views/bookmarks/tally.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h1 class="text-2xl font-bold mb-4">Bookmarks tally</h1>
44

55
<!-- Filter form -->
6-
<%= form_tag('/bookmarks/tally', method: :get, class: "space-y-4", data: { controller: "collection" }) do %>
6+
<%= form_tag('/bookmarks/tally', method: :get, class: "space-y-4", data: { controller: "collection", action: "change->collection#handleChange input->collection#handleInput" }) do %>
77
<%= render "search_fields" %>
88
<% end %>
99

app/views/community_news/_search_boxes.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<%= form_with url: community_news_index_path,
33
method: :get,
44
data: {controller: "collection",
5+
action: "change->collection#handleChange input->collection#handleInput",
56
turbo_frame: "community_news_results" },
67
autocomplete: "off",
78
class: "space-y-2" do |f| %>

app/views/events/_manage_search.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= form_with url: manage_event_path(@event), method: :get,
2-
data: { controller: "collection", turbo_frame: "manage_results" },
2+
data: { controller: "collection", action: "change->collection#handleChange input->collection#handleInput", turbo_frame: "manage_results" },
33
autocomplete: "off",
44
class: "flex flex-col md:flex-row md:flex-wrap md:items-end gap-4 mb-6" do %>
55

app/views/faqs/_search_boxes.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= form_tag(faqs_path, method: :get, class: "space-y-4", data: { controller: "collection" }) do |f| %>
1+
<%= form_tag(faqs_path, method: :get, class: "space-y-4", data: { controller: "collection", action: "change->collection#handleChange input->collection#handleInput" }) do |f| %>
22
<div class="flex flex-col md:flex-row md:items-end md:gap-4 mb-6">
33
<!-- Search -->
44
<div class="w-full md:flex-1 mb-3 md:mb-0">

app/views/notifications/_search_boxes.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<%= form_with url: notifications_path,
44
method: :get,
55
data: {controller: "collection",
6+
action: "change->collection#handleChange input->collection#handleInput",
67
turbo_frame: "notifications_results" },
78
autocomplete: "off",
89
class: "flex flex-wrap gap-4" do |f| %>

app/views/organizations/_search_boxes.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="mb-4">
22
<%= form_with url: organizations_path, method: :get,
3-
data: { controller: "collection", turbo_frame: "organization_results" },
3+
data: { controller: "collection", action: "change->collection#handleChange input->collection#handleInput", turbo_frame: "organization_results" },
44
autocomplete: "off",
55
class: "flex flex-wrap items-end gap-3" do %>
66
<div>

app/views/people/_search_boxes.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= form_tag(people_path, method: :get,
2-
data: { controller: "collection", turbo_frame: "people_results" },
2+
data: { controller: "collection", action: "change->collection#handleChange input->collection#handleInput", turbo_frame: "people_results" },
33
autocomplete: "off",
44
class: "space-y-4") do |f| %>
55
<div class="flex flex-col md:flex-row md:flex-wrap md:items-end gap-4 mb-6">

app/views/quotes/_search_boxes.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<div class="mb-6 p-4 bg-white border border-gray-200 rounded-lg">
33
<%= form_with url: quotes_path,
44
method: :get,
5-
data: {controller: "collection"},
5+
data: {controller: "collection",
6+
action: "change->collection#handleChange input->collection#handleInput"},
67
autocomplete: "off",
78
class: "flex flex-wrap gap-4" do |f| %>
89
<div class="flex-grow min-w-[200px]">

app/views/resources/_search_boxes.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<%= form_tag resources_path, method: :get,
88
data: {controller: "collection share-url",
9+
action: "change->collection#handleChange input->collection#handleInput",
910
collection_unselected_class: default_btn,
1011
collection_selected_class: selected_btn,
1112
turbo_frame: "resource_results" },

0 commit comments

Comments
 (0)