If they answered before I couldn’t find him.
I have the following:
= f.collection_select :sex_id, @sexes, :id, :name
and this is in the controller:
@sexes = Sex.all
all floors are stored in lower case, for example:
id|name 1|steer 2|heifer 3|holstein
I need them to be displayed with the letters "First letter":
Steer Heifer Holstein
I tried:
= f.collection_select :sex_id, @sexes, :id, :name.capitalize = f.collection_select :sex_id, @sexes, 'id', 'name'.capitalize
but they don’t work, and I didn’t really expect them, but I had to try them before publishing it.
collections capitalize ruby-on-rails
Toby joiner
source share