Skip to content

Commit 15c05a4

Browse files
committed
use humanize and upcase_first for checkbox labels
matches how the names of the dietary restrictions are displayed when showing a profile.
1 parent 5591992 commit 15c05a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/views/member/details/edit.html.haml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
= f.input :about_you, as: :text, label: t('member.details.edit.coach.about_you'), input_html: { rows: 3 }, required: true
1616
- else
1717
= f.input :about_you, as: :text, label: t('member.details.edit.student.about_you'), input_html: { rows: 3 }, required: true
18-
= f.input :dietary_restrictions, collection: Member::DIETARY_RESTRICTIONS, as: :check_boxes, label_method: :titleize
18+
= f.input :dietary_restrictions, collection: Member::DIETARY_RESTRICTIONS, as: :check_boxes,
19+
label_method: ->(r) { r.humanize.upcase_first }
1920
= f.input :other_dietary_restrictions, placeholder: 'Other dietary restrictions',
2021
wrapper_html: { class: class_names('mt-n3', 'd-none': !@member.other_dietary_restrictions?) }, label_html: { class: 'sr-only' }
2122
= f.input :newsletter, as: :boolean, checked_value: true, unchecked_value: false

app/views/members/_new.html.haml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
.col-12
1414
= f.input :about_you, as: :text, label: 'Tell us a little bit about yourself', input_html: { rows: 3 }, required: true
1515
.col-12
16-
= f.input :dietary_restrictions, collection: Member::DIETARY_RESTRICTIONS, as: :check_boxes, label_method: :titleize
16+
= f.input :dietary_restrictions, collection: Member::DIETARY_RESTRICTIONS, as: :check_boxes,
17+
label_method: ->(r) { r.humanize.upcase_first }
1718
= f.input :other_dietary_restrictions, placeholder: 'Other dietary restrictions',
1819
wrapper_html: { class: class_names('mt-n3', 'd-none': !@member.other_dietary_restrictions?) }, label_html: { class: 'sr-only' }
1920
- if @member.coach?

0 commit comments

Comments
 (0)