Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Titleize does not work on words with dashes #66

Open
corroded opened this issue Jun 13, 2017 · 2 comments
Open

Titleize does not work on words with dashes #66

corroded opened this issue Jun 13, 2017 · 2 comments

Comments

@corroded
Copy link

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"
@CristhianMotoche
Copy link

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?

@CristhianMotoche
Copy link

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 _?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants