Create new bubbles automatically and land on the perma

...so we don't have to deal with a separate create state
This commit is contained in:
Jason Zimdars
2024-09-06 16:36:30 -05:00
parent ea6a968034
commit 3ad48466f6
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ class BubblesController < ApplicationController
end
def create
Bubble.create! bubble_params
@bubble = Bubble.create! bubble_params
redirect_to bubbles_path
redirect_to bubble_path(@bubble)
end
def show
+1 -2
View File
@@ -17,8 +17,7 @@
<% end %>
<% end %>
</h1>
<%= link_to new_bubble_path, class: "btn btn--plain flex-item-justify-end" do %>
<%= button_to bubbles_path, method: :post, params: { bubble: { title: "Untitled"} }, class: "btn btn--plain", form_class: "flex-item-justify-end" do %>
<%= image_tag "bubble-add.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Create a new bubble</span>
<% end %>