rails/rails — Issue #4519: String#underscore doesn't convert spaces to underscores
Author: shtirlic
Created: 2012-01-18 13:19:10+00:00
State: open

Why Rails String#underscore doesn't convert spaces to underscores?
The same is for String#camelize why it doesn't convert spaces to nothing?
Is there something behind it or I am missing the point?

```ruby
1.9.3-p0 :001 > "Hello World".underscore
=> "hello world"
1.9.3-p0 :002 > "HelloWorld".underscore
=> "hello_world"

```

```ruby
1.9.3-p0 :004 > "hello_world".camelize
=> "HelloWorld"
1.9.3-p0 :005 > "hello world".camelize
=> "Hello world"

```