Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Phoenix.Naming.titleize/1#6508

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nathanl wants to merge1 commit intophoenixframework:main
base:main
Choose a base branch
Loading
fromnathanl:titleize

Conversation

@nathanl
Copy link
Contributor

No description provided.

@chrismccord
Copy link
Member

Do you need this for broader generator use or convenience for your own apps? Not opposed, just wondering if this is part of some larger work or not, but we also have to decide how much we want to place here if we're thinking about adding more utilities. THanks!

@nathanl
Copy link
ContributorAuthor

nathanl commentedOct 8, 2025
edited
Loading

Convenience in an app. My current example: converting the snake case atoms of an Ecto enum type, like:deep_freezer, into a form select option. "Deep Freezer" looks more like an expected dropdown value to me than "Deep freezer". Personally I want something like this more often thanhumanize/1, but maybe that's just me.

Comment on lines +150 to +155
bin=
ifString.ends_with?(bin,"_id")do
binary_part(bin,0,byte_size(bin)-3)
else
bin
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe the API could be similar to one provided in Rails?https://apidock.com/rails/String/humanize
(I mean thekeep_id_suffix part)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@itamm15itamm15itamm15 left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@nathanl@chrismccord@itamm15

[8]ページ先頭

©2009-2025 Movatter.jp