Rails problem with humanize
Asked Answered
D

1

13

I am trying to humanize the symbols that are the keys for a hash

c.each_key{ |f| humanize(f.to_s)}

but for some reason, i get an error like so

ActionView::Template::Error (undefined method 'humanize' for #<#<Class:0xb5b77a4>:0xb5b6598>)

any idea what is going wrong here?

Dyanna answered 6/1, 2011 at 20:52 Comment(1)
Looks like you came from PHP ;)Odo
N
28

Try this way.

c.each_key{ |f| f.to_s.humanize}
Nereus answered 6/1, 2011 at 21:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.