ruby on rails - How to use methods define in http://www.rubydoc.info/ site -
i have open rails console , want use pluralize method getting error nomethoderror: undefined method
pluralize' main:object`
pluralize(1, 'person')
i can see documentation method here http://www.rubydoc.info/docs/rails/4.1.7/actionview/helpers/texthelper#pluralize-instance_method don't know how use documentation. have tried below code didn't work
actionview::helpers::texthelper.new.puralize(1, 'person') actionview::helpers.new.pluralize(1 , 'person')
please
thanks,
use:
include actionview::helpers::texthelper
not:
actionview::helpers::texthelper.new.puralize(1, 'person') or actionview::helpers.new.pluralize(1 , 'person')
Comments
Post a Comment