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 methodpluralize' 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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -