Inflector methods not working in my rails project

111 views Asked by At

I found a method humanize that I want to use in my rails project.

app/views/audits/_show.html.erb

<%= humanize('inappropriate_writing') %>

but I get this error:

undefined method `humanize' for #<#<Class:0x00007fb4f1f98208>:0x00007fb4f39107a8>

Do some rails methods not work out of the box? Am I supposed to "include ActiveSupport::Inflector" somewhere? If so I can't work out where.

1

There are 1 answers

1
Kiran Mahale On BEST ANSWER

You should use humanize method like this "inappropriate_writing".humanize which will give output like Inappropriate writing.