Simplify generating checkboxes in forms
Using the block syntax to generate the label with a <span> tag inside isn't necessary after upgrading foundation_rails_helpers. Before the upgrade, we couldn't do so because the <span> tag was escaped.
This commit is contained in:
@@ -18,14 +18,18 @@
|
||||
|
||||
<% if can? :comment_as_moderator, commentable %>
|
||||
<div class="float-right">
|
||||
<%= f.check_box :as_moderator, title: t("comments.form.comment_as_moderator"), id: "comment-as-moderator-#{css_id}", label: false %>
|
||||
<%= label_tag "comment-as-moderator-#{css_id}", t("comments.form.comment_as_moderator"), class: "checkbox" %>
|
||||
<%= f.check_box :as_moderator,
|
||||
label: t("comments.form.comment_as_moderator"),
|
||||
id: "comment-as-moderator-#{css_id}",
|
||||
label_options: { for: "comment-as-moderator-#{css_id}" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if can? :comment_as_administrator, commentable %>
|
||||
<div class="float-right">
|
||||
<%= f.check_box :as_administrator, title: t("comments.form.comment_as_admin"), id: "comment-as-administrator-#{css_id}", label: false %>
|
||||
<%= label_tag "comment-as-administrator-#{css_id}", t("comments.form.comment_as_admin"), class: "checkbox" %>
|
||||
<%= f.check_box :as_administrator,
|
||||
label: t("comments.form.comment_as_admin"),
|
||||
id: "comment-as-administrator-#{css_id}",
|
||||
label_options: { for: "comment-as-administrator-#{css_id}" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user