Move readings under bubbles and out of double nesting

This commit is contained in:
David Heinemeier Hansson
2025-04-07 14:06:56 +02:00
parent bcd6c6dd66
commit 23892296da
4 changed files with 5 additions and 8 deletions
@@ -1,4 +1,4 @@
class ReadingsController < ApplicationController
class Bubbles::ReadingsController < ApplicationController
include BubbleScoped
def create
+1 -1
View File
@@ -51,7 +51,7 @@
</nav>
<% end %>
<div data-controller="beacon" data-beacon-url-value="<%= bucket_bubble_readings_url(@bubble.bucket, @bubble) %>">
<div data-controller="beacon" data-beacon-url-value="<%= bubble_reading_url(@bubble) %>">
<div class="card__container position-relative <%= "card__container--pointing" unless @bubble.published? %>" style="--bubble-color: <%= @bubble.color %>;">
<%= render "bubbles/cards/perma", bubble: @bubble %>
+1 -4
View File
@@ -15,6 +15,7 @@ Rails.application.routes.draw do
resource :pin
resource :pop
resource :publish
resource :reading
resource :recover
resource :watch
@@ -50,10 +51,6 @@ Rails.application.routes.draw do
resources :comments do
resources :reactions, module: :comments
end
resource :readings, only: :create
scope module: :bubbles do
end
end
end
@@ -1,13 +1,13 @@
require "test_helper"
class ReadingsControllerTest < ActionDispatch::IntegrationTest
class Bubbles::ReadingsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "index" do
assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: false, to: true do
post bucket_bubble_readings_url(bubbles(:logo).bucket, bubbles(:logo)), as: :turbo_stream
post bubble_reading_url(bubbles(:logo)), as: :turbo_stream
end
assert_response :success