Generate labels for attribute automatically
I'm not sure why it isn't already done by foundation's form builder. It doesn't make any sense to change an ID of a form field without changing the `for` attribute of its label.
This commit is contained in:
@@ -25,8 +25,11 @@
|
||||
<% css_id = parent_or_commentable_dom_id(nil, annotation) %>
|
||||
<div id="js-comment-form-annotation-<%= annotation.id %>" style="display:none" class="comment-form js-comment-form-annotation">
|
||||
<%= form_for @comment, url: legislation_process_draft_version_annotation_new_comment_path(annotation.draft_version.process, annotation.draft_version, annotation), remote: true do |f| %>
|
||||
<%= label_tag "comment-body-#{css_id}", leave_comment_text(annotation) %>
|
||||
<%= f.text_area :body, id: "comment-body-#{css_id}", maxlength: Comment.body_max_length, label: false, rows: 8 %>
|
||||
<%= f.text_area :body,
|
||||
id: "comment-body-#{css_id}",
|
||||
maxlength: Comment.body_max_length,
|
||||
label: leave_comment_text(annotation),
|
||||
rows: 8 %>
|
||||
<%= f.submit comment_button_text(nil, annotation), class: "button" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user