Resolve bubble to bucket_bubble for ease of redirecting

This commit is contained in:
David Heinemeier Hansson
2024-10-19 19:48:31 -07:00
parent e75e585f03
commit 0c5778495e
7 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ class AssignmentsController < ApplicationController
def create
@bubble.assign(find_assignee)
redirect_to bucket_bubble_path(@bucket, @bubble)
redirect_to @bubble
end
private
+1 -1
View File
@@ -3,6 +3,6 @@ class Bubbles::ImagesController < ApplicationController
def destroy
@bubble.image.purge_later
redirect_to bucket_bubble_path(@bubble.bucket, @bubble)
redirect_to @bubble
end
end
+2 -2
View File
@@ -3,11 +3,11 @@ class Bubbles::PopsController < ApplicationController
def create
@bubble.pop!
redirect_to bucket_bubble_path(@bubble.bucket, @bubble)
redirect_to @bubble
end
def destroy
@bubble.unpop
redirect_to bucket_bubble_path(@bubble.bucket, @bubble)
redirect_to @bubble
end
end
+2 -2
View File
@@ -15,7 +15,7 @@ class BubblesController < ApplicationController
def create
@bubble = @bucket.bubbles.create!
redirect_to bucket_bubble_path(@bucket, @bubble)
redirect_to @bubble
end
def show
@@ -27,7 +27,7 @@ class BubblesController < ApplicationController
def update
@bubble.update! bubble_params
redirect_to bucket_bubble_path(@bucket, @bubble)
redirect_to @bubble
end
private
+1 -1
View File
@@ -3,6 +3,6 @@ class CommentsController < ApplicationController
def create
@bubble.comment! params.expect(comment: [ :body ])
redirect_to bucket_bubble_path(@bucket, @bubble)
redirect_to @bubble
end
end
+1 -1
View File
@@ -13,7 +13,7 @@ class TagsController < ApplicationController
def create
@bubble.tags << Current.account.tags.find_or_create_by!(tag_params)
redirect_to bucket_bubble_path(@bucket, @bubble)
redirect_to @bubble
end
def destroy
+4
View File
@@ -28,6 +28,10 @@ Rails.application.routes.draw do
resources :tags, only: :index
end
resolve "Bubble" do |bubble, options|
route_for :bucket_bubble, bubble.bucket, bubble, options
end
resource :first_run
resource :session