NoMethodError for underscore
Posted
by siulamvictor
on Stack Overflow
See other posts from Stack Overflow
or by siulamvictor
Published on 2010-04-21T08:36:38Z
Indexed on
2010/04/21
9:03 UTC
Read the original article
Hit count: 327
ruby-on-rails
|ruby
I want to convert the string
"Full Time"
to
"full_time"
When I using "Full Time".underscore in irb, it prompt a error
NoMethodError: undefined method `underscore' for "Full Time":String
How can I fix it? Or is there any other way for me to get the above underscored result?
© Stack Overflow or respective owner