Created
September 3, 2014 13:41
-
-
Save rohozhnikoff/9c4c1090b2963ee0dc7f to your computer and use it in GitHub Desktop.
simple helper to add 's' if length more then 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`import Ember from 'ember'` | |
oneormany = (length, value) -> | |
return "There are no #{value}s" if length is 0 | |
suffix = if length > 1 then 's' else '' | |
return "#{length} #{value}#{suffix}" | |
OneormanyHelper = Ember.Handlebars.helper 'oneormany', oneormany | |
`export { oneormany }` | |
`export default OneormanyHelper` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment