-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pause application toggle to pets page (#375)
Change toggle position to center of column Add toggle virtual attribute to pets The toggle attr is used as a condition for turbo_stream depending one where the pet is updated from. Change unused turbo_frame to div Add testing for toggle turbo_stream Revert model file to upstream
- Loading branch information
Showing
6 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div id=<%= "pet_pause_toggle_#{pet.id}" %>> | ||
<%= form_with model: pet do |form| %> | ||
<div class='form-group d-flex justify-content-center'> | ||
<div class="form-check form-switch"> | ||
<%= form.hidden_field :application_paused, value: false %> | ||
<%= form.hidden_field :toggle, value: 'true' %> | ||
<%= form.check_box :application_paused,{ class: "form-check-input", | ||
role: "switch", id: "flexSwitchCheckChecked", onchange: "this.form.requestSubmit()"}, true, false %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= turbo_stream.replace "pet_pause_toggle_#{@pet.id}", partial: "pause_toggle", | ||
locals: {pet: @pet} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters