Shiva Profile picture
https://t.co/aQ1DGvQ1Fo .Passionate Tech AI enthusiast & polyglot developer. Co-founder of https://t.co/CUIVlEBXXC, ReaderMonk & Mumbai.rb. Tweets are my own. #buildinpublic

Mar 9, 2023, 10 tweets

Want to level up your Rails skills? Check out this thread on string manipulation tips! 🧵
#rubyonrails #rails

CamelCase: It converts the first and second letters of each word to uppercase. Great for words with underscores

dasherize: Replace underscore with a hyphen

titleize(alias `titlecase`): Capitalize the first letter of the word in the sentences. Best for showcasing header or title.

tablesize: Is the reverse of classify. Pluralize the string to a table name

demodulize: Remove the module part from the constant expression string

deconstantize: Remove the rightmost segment from the constant expression string

Bonus

humanize: Does multiple things, delete the underscore, Capitalize the first word, substitutes underscore with space, and removes an "_id" suffix

Check out the previous thread if haven't you will find helpful tips like this

Found it useful, learned something new? Help others level up their skills Share this thread or RT to spread the word to your fellow Rails devs! #RubyOnRails

I'm passionate about #buildinginpublic, web development, and sharing what I learn.
follow me @_rshiva

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling