Ruby on Rails: Converting "SomeWordHere" to "some word here"

Posted by sjsc on Stack Overflow See other posts from Stack Overflow or by sjsc
Published on 2010-05-16T02:56:22Z Indexed on 2010/05/16 3:00 UTC
Read the original article Hit count: 265

Filed under:
|

I know you can do something like:

"SomeWordHere".underscore.gsub("_", " ") 

to get "some word here".

I thought that might be a little too much for something so simple. Is there a more efficient way (maybe a built-in method?) to convert "SomeWordHere" to "some word here"?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby