Replace "editing" param with creating? state
This commit is contained in:
@@ -12,7 +12,7 @@ class BubblesController < ApplicationController
|
||||
|
||||
def create
|
||||
@bubble = @bucket.bubbles.create!
|
||||
redirect_to bucket_bubble_path(@bubble.bucket, @bubble, editing: true)
|
||||
redirect_to bucket_bubble_path(@bubble.bucket, @bubble)
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<div>
|
||||
<h1 class="bubble__title">
|
||||
<% if local_assigns[:editing] %>
|
||||
<% if bubble.creating? %>
|
||||
<%= turbo_frame_tag bubble, :edit, src: edit_bucket_bubble_path(bubble.bucket, bubble) %>
|
||||
<% else %>
|
||||
<%= turbo_frame_tag bubble, :edit do %>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
<div class="bubble__container" data-controller="beacon" data-beacon-url-value="<%= bucket_bubble_readings_url(@bubble.bucket, @bubble) %>">
|
||||
<div class="bubble__perma flex justify-center center">
|
||||
<%= render "bubbles/bubble", bubble: @bubble, editing: params[:editing] %>
|
||||
<%= render "bubbles/bubble", bubble: @bubble %>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class BubblesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_difference "Bubble.count", 1 do
|
||||
post bucket_bubbles_url(buckets(:writebook))
|
||||
end
|
||||
assert_redirected_to bucket_bubble_url(buckets(:writebook), Bubble.last, editing: true)
|
||||
assert_redirected_to bucket_bubble_url(buckets(:writebook), Bubble.last)
|
||||
end
|
||||
|
||||
test "show" do
|
||||
|
||||
Reference in New Issue
Block a user