Move bubbles publish out from the double nesting

This commit is contained in:
David Heinemeier Hansson
2025-04-07 13:55:12 +02:00
parent ce0c6146be
commit 481be72162
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
<%= button_to bucket_bubble_publish_path(bubble.bucket, bubble), class: "btn txt-small btn--link", style: "--btn-background: #{ bubble.color }" do %>
<%= button_to bubble_publish_path(bubble), class: "btn txt-small btn--link", style: "--btn-background: #{bubble.color}" do %>
<span>Post to project</span>
<% end %>
+1 -1
View File
@@ -111,7 +111,7 @@
<% if @bubble.creating? %>
<div class="margin-block-start flex align-center gap">
<%= button_to "Create card", bucket_bubble_publish_path(@bubble.bucket, @bubble), class: "btn btn--reversed" %>
<%= button_to "Create card", bubble_publish_path(@bubble), class: "btn btn--reversed" %>
<%= button_to "Save as draft", bucket_bubble_path(@bubble.bucket, @bubble), name: "bubble[status]", value: "drafted", method: :put, class: "btn" %>
</div>
<% end %>
+1 -1
View File
@@ -13,6 +13,7 @@ Rails.application.routes.draw do
resource :image
resource :pin
resource :pop
resource :publish
resource :watch
resources :assignments
@@ -50,7 +51,6 @@ Rails.application.routes.draw do
resource :readings, only: :create
scope module: :bubbles do
resource :publish
resource :recover
resources :stagings
end
@@ -10,7 +10,7 @@ class Bubbles::PublishesControllerTest < ActionDispatch::IntegrationTest
bubble.drafted!
assert_changes -> { bubble.reload.published? }, from: false, to: true do
post bucket_bubble_publish_url(bubble.bucket, bubble)
post bubble_publish_path(bubble)
end
assert_redirected_to bubble