diff --git a/app/controllers/assignments_controller.rb b/app/controllers/assignments_controller.rb index 6e6fd3477..05ce8a5b5 100644 --- a/app/controllers/assignments_controller.rb +++ b/app/controllers/assignments_controller.rb @@ -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 diff --git a/app/controllers/bubbles/images_controller.rb b/app/controllers/bubbles/images_controller.rb index ae73bde3c..005eb967d 100644 --- a/app/controllers/bubbles/images_controller.rb +++ b/app/controllers/bubbles/images_controller.rb @@ -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 diff --git a/app/controllers/bubbles/pops_controller.rb b/app/controllers/bubbles/pops_controller.rb index 6a780823b..c19784433 100644 --- a/app/controllers/bubbles/pops_controller.rb +++ b/app/controllers/bubbles/pops_controller.rb @@ -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 diff --git a/app/controllers/bubbles_controller.rb b/app/controllers/bubbles_controller.rb index 95da3f6d9..741e61c91 100644 --- a/app/controllers/bubbles_controller.rb +++ b/app/controllers/bubbles_controller.rb @@ -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 diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 42bef3a2e..ba9690226 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -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 diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index e389121b2..4490d1fbf 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 5d86ff2ec..4286d0fa8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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