Skip to content

Commit

Permalink
Merge pull request #180 from mrhead/form-with-namespace
Browse files Browse the repository at this point in the history
Pass namespace to `form_with` when editing to-dos
  • Loading branch information
mrhead authored Feb 28, 2024
2 parents 0d5c881 + ad2f385 commit cc063fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/todos/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= turbo_frame_tag @todo, "frame" do %>
<div class="todo-list__todo">
<%= form_with model: @todo, class: "form flex-grow" do |form| %>
<%= form_with model: @todo, namespace: "edit_#{@todo.id}", class: "form flex-grow" do |form| %>
<div class="form__field">
<%= form.text_field :name, data: { controller: "auto-select" }, class: "form__input", autocomplete: :off %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/system/manage_todos_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ManageTodosTest < ApplicationSystemTestCase
find("#todo_#{todo.id}").hover
within "#todo_#{todo.id}" do
click_link "Edit"
fill_in :todo_name, with: "New name"
fill_in "edit_#{todo.id}_todo_name", with: "New name"
click_button "Save"
end

Expand Down

0 comments on commit cc063fc

Please sign in to comment.