Skip to content

Commit 9334a1f

Browse files
committed
Correctly set id attribute for form_for
Amends ecd1d7b
1 parent 488dc22 commit 9334a1f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/views/collections/_form.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- append_stylesheet_pack_tag('toast-ui')
44

55
.my-4
6-
= form_for @collection, builder: MarkdownFormBuilder, data: {turbo: false}, id: 'edit_collection' do |f|
6+
= form_for @collection, builder: MarkdownFormBuilder, data: {turbo: false}, html: {id: @collection.new_record? ? 'new_collection' : "edit_collection_#{@collection.id}"} do |f|
77
= render('shared/form_errors', object: @collection)
88
.form-group
99
.field-element

app/views/comments/_edit.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.comment-text
22
.comment-text-input
3-
= form_for :comment, url: task_comment_path(@task, @comment), method: :put, remote: true, id: "edit_comment_#{@comment.id}", class: 'd-inline' do |f|
3+
= form_for :comment, url: task_comment_path(@task, @comment), method: :put, remote: true, html: {id: "edit_comment_#{@comment.id}"}, class: 'd-inline' do |f|
44
= f.text_field :text, class: 'form-control'
55
.actions.btn-group.float-end role='group'
66
- if policy(@comment).edit?

app/views/users/registrations/edit.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
=< t('devise.registrations.edit.title', resource: User.model_name.human)
77

88
.row.my-4
9-
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}, id: 'edit_user') do |f|
9+
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'edit_user'}) do |f|
1010
= render('shared/form_errors', object: resource, title: t('common.errors.changes_not_saved'))
1111

1212
.form-group.field-element

0 commit comments

Comments
 (0)