From f7d7ea6e495861dfbcb48ec7fcccb15687e4b7a1 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 14 Nov 2024 12:30:05 -0600 Subject: [PATCH] No need for turbo frames after all --- .../{bubbles => }/assignments_controller.rb | 2 +- app/views/bubbles/_assignments.html.erb | 24 +++++++++++++++++ app/views/bubbles/_bubble.html.erb | 2 +- app/views/bubbles/assignments/show.html.erb | 26 ------------------- config/routes.rb | 2 +- 5 files changed, 27 insertions(+), 29 deletions(-) rename app/controllers/{bubbles => }/assignments_controller.rb (80%) create mode 100644 app/views/bubbles/_assignments.html.erb delete mode 100644 app/views/bubbles/assignments/show.html.erb diff --git a/app/controllers/bubbles/assignments_controller.rb b/app/controllers/assignments_controller.rb similarity index 80% rename from app/controllers/bubbles/assignments_controller.rb rename to app/controllers/assignments_controller.rb index f7a8774c3..872725b53 100644 --- a/app/controllers/bubbles/assignments_controller.rb +++ b/app/controllers/assignments_controller.rb @@ -1,4 +1,4 @@ -class Bubbles::AssignmentsController < ApplicationController +class AssignmentsController < ApplicationController include BubbleScoped, BucketScoped def new diff --git a/app/views/bubbles/_assignments.html.erb b/app/views/bubbles/_assignments.html.erb new file mode 100644 index 000000000..ca46c0a01 --- /dev/null +++ b/app/views/bubbles/_assignments.html.erb @@ -0,0 +1,24 @@ +<% if bubble.assignments.any? %> +
+ <%= form_with url: bucket_bubble_assignments_path(bubble.bucket, bubble), data: { controller: "form" } do |form| %> + + <% end %> +
+<% end %> diff --git a/app/views/bubbles/_bubble.html.erb b/app/views/bubbles/_bubble.html.erb index 9cbffe4c1..03ea60bf3 100644 --- a/app/views/bubbles/_bubble.html.erb +++ b/app/views/bubbles/_bubble.html.erb @@ -16,7 +16,7 @@ <%= bubble.title %> <% end %> - <%= turbo_frame_tag dom_id(bubble, :assignments), src: bucket_bubble_assignments_path(bubble.bucket, bubble) %> + <%= render "bubbles/assignments", bubble: bubble %> <%= render "bubbles/boosts", bubble: bubble %> <%= render "bubbles/color", bubble: bubble %> <%= turbo_frame_tag dom_id(bubble, :date_picker), src: bucket_bubble_date_picker_path(bubble.bucket, bubble) %> diff --git a/app/views/bubbles/assignments/show.html.erb b/app/views/bubbles/assignments/show.html.erb deleted file mode 100644 index e3e9d9662..000000000 --- a/app/views/bubbles/assignments/show.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= turbo_frame_tag dom_id(@bubble, :assignments) do %> - <% if @bubble.assignments.any? %> -
- <%= form_with url: bucket_bubble_assignments_path(@bubble.bucket, @bubble), data: { controller: "form", turbo_frame: "_top" } do |form| %> - - <% end %> -
- <% end %> -<% end %> diff --git a/config/routes.rb b/config/routes.rb index fea9436d1..18b5091ac 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,7 @@ Rails.application.routes.draw do resources :buckets do resources :bubbles do + resources :assignments resources :boosts resources :comments resources :tags, shallow: true @@ -25,7 +26,6 @@ Rails.application.routes.draw do resource :pop resource :stage_picker resource :date_picker - resource :assignments resources :stagings end end