Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails capitalise check_box_tag entries

In my rails 3.0 app I have a set of check_box_tags each with a label. I would like the labels to those check boxes to keep their case.

EG: The 'School/College' label is turned into 'School/college' and any abbreviations such as 'RAAF' is turned into 'Raaf' when used within a check_box_tag. Here is the code I'm using:

%h2 Chaplains
- for chaplain in Chaplain.all
= check_box_tag "clergy[chaplain_ids][]",chaplain.id,@clergy.chaplains.include?(chaplain)
= f.label chaplain.name
%br
like image 289
map7 Avatar asked Jan 09 '12 00:01

map7


1 Answers

You can do one of the following ways to retain the capitalization

  = label_tag chaplain.id, chaplain.name

  = f.label chaplain.id, chaplain.name

  = content_tag :label, chaplain.name
like image 112
Aj Gu Avatar answered Nov 03 '22 15:11

Aj Gu