Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSteven Lee
2,955 PointsWhy isn't my code working
I can't seem to figure out why this isn't working
{{ num_elf }} el{{ num_elf|pluralize:"f, ves" }}.
2 Answers
Amanda Allison
9,104 PointsNearly there! You'll need to include the "f" on the end of "elf" in the template, so the plurarlize filter knows which value to substitute when it applies "ves":
{{ num_elf }} elf{{ num_elf|pluralize:"f,ves" }}
josephr
18,877 PointsI imagine you have already figured this out, but for the sake of others searching for answer:
It isn't working because of the space between the comma and "ves". I believe it is treating that space as part of the string you wish to append to "el." Not including the 'f' at the end is correct since we are providing the arguments for both singular and plural cases.
{{ num_elf }} el{{ num_elf|pluralize:"f,ves" }}