node.inflection
node.inflection copied to clipboard
Titleize does not work on words with dashes
Example:
inflection.titleize("x-men:-the-last-stand")
"X-Men:-the-Last-Stand"
For comparison on Rails 4.2:
Loading development environment (Rails 4.2.7.1)
irb(main):001:0> ActiveSupport::Inflector.titleize("x-men:-the-last-stand")
=> "X Men: The Last Stand"
And Rails 5:
Loading development environment (Rails 5.1.1)
irb(main):001:0> ActiveSupport::Inflector.titleize("x-men:-the-last-stand")
=> "X Men: The Last Stand"
I was expecting camelize
and humanize
to work the same but I also experience that it doesn't affect dasherized words:
camelize('hello-world') === 'Hello-world'
Is this also expected?
I would also expect underscore
to replace dasherized words but it doesn't:
underscore('hello-world') === 'hello-world'
Would it make sense to make underscore
replace -
with _
?