Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo Streams Deletes #4

Open
wants to merge 3 commits into
base: turbo-frames-top
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/board_columns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def destroy

respond_to do |format|
format.html { redirect_to board_url(board), notice: "BoardColumn was successfully destroyed." }
format.turbo_stream { render turbo_stream: turbo_stream.remove(@board_column) }
end
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/boards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def destroy

respond_to do |format|
format.html { redirect_to boards_url, notice: "Board was successfully destroyed." }
format.turbo_stream { render turbo_stream: turbo_stream.remove(@board) }
end
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/cards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def destroy

respond_to do |format|
format.html { redirect_to board_url(board), notice: "Card was successfully destroyed." }
format.turbo_stream
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/board_columns/_board_column.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="board-column" data-sortable-column-id-value="<%= board_column.id %>">
<div id= <%= dom_id(board_column)%> class="board-column" data-sortable-column-id-value="<%= board_column.id %>">
<%= render partial: 'board_columns/column_header', locals: { board_column: board_column } %>

<div id= <%= dom_id(board_column, :column_body) %> class="board-column-body" data-sortable-target="cardsContainer">
Expand Down
2 changes: 1 addition & 1 deletion app/views/boards/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="row w-100">
<% @boards.each do |board| %>
<div class="col-3 my-3">
<div id= <%= dom_id(board) %> class="col-3 my-3">
<div class="card border border-primary-grey-200">
<%= turbo_frame_tag dom_id(board, :edit) do %>
<div class="card-header bg-primary-grey-200">
Expand Down
1 change: 1 addition & 0 deletions app/views/cards/destroy.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= turbo_stream.remove dom_id(@card) %>