I have the following span, I want to use the method pluralize, till there is items equal to 1, I want to display 1 item, at the moment it is by default 0 items, If something gets added it says 1 items
<span id="cartitems">
<%=@size%>
items
</span>
Please use Rails I18n and write something like:
I18n.t('items', count: @size)
and then in your config/locales/en.yml
file:
en:
items:
zero: "no items"
one: "one item"
other: "%{count} items"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With