开发者

Rails problem with humanize

开发者 https://www.devze.com 2023-02-03 11:16 出处:网络
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

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>:0xb5开发者_如何学运维b6598>)

any idea what is going wrong here?


Try this way.

c.each_key{ |f| f.to_s.humanize}
0

精彩评论

暂无评论...
验证码 换一张
取 消