Short Ruby Newsletter

Share this post

Issue #1 - 11 - 17 July 2022

newsletter.shortruby.com

Issue #1 - 11 - 17 July 2022

Curated code and ideas shared in the second week of July in Ruby world (mostly on Twitter)

Lucian Ghinda
Jul 18, 2022
Share this post

Issue #1 - 11 - 17 July 2022

newsletter.shortruby.com

General

Aaron Patterson is writing about why he loves programming:

source

Ruby and Rails code and ideas

Jim Gay is sharing an example of how to create a class in Ruby:

Thanks for reading Short Ruby Learnings! Subscribe for free to receive new posts and support my work.

source

he also shares how to read the source code of a gem:

source

Alexandre Ruban shares an excellent way to declare all methods as module functions:

source

Emmanuel Hayford also replies with the example of using module_function to achieve the same thing:


Nate Berkopec asked about the difference between interned strings (Symbols) and frozen string literals. Jean Boussier has a good and short reply explaining the difference:


Ryan Davis shares a kind of controversy about conditionals in Ruby":

It is worth reading the thread responses.


Steve Polito is sharing an example about setting the job that mailers are calling when using deliver later:

Source

He is also sharing another idea about how to use Devise build-in email regex to validate emails in your own model

Source

Joe Masilotti asked a great question about how to customize controller tests and location when using scaffold generators in Rails.

He received a response from Rafael Franca about using a hook to register a test generator and provided a link to the source where this hook is defined. You should check the whole discussion as it also has some other interesting ideas.


Joel Drapper is sharing some nice code examples about generating static components in the new gem that he is working on Phlex (a new library to create reusable view components). Read the thread as there are some inspiring ideas on how to build chained method calls:

Source

Joel also wrote a good thread about improving the rendering time in views for railsdevs.com. There you will also find a prefetch controller example shared by Julian Rubisch that can be used for prefetching.


CJ Avilla is sharing a great thread about lessons learned while trying to evade a spammer in a Rails 4.2 app. Most of the learnings are valid for any Rails version so it is worth reading it.

Source

Rafal Piekara is explaining in a tweet the difference between .select and .detect in Ruby:

source

Rob Zolkos recommends executing bin/rails zeitwerk:check in CI environment to check if all classes will load ok:

source

Shino Kouda is sharing how to use infinity in Ruby:

source

Samuel Williams is sharing an example of how to inject behavior into an object when a specific method is called:

source

Emmanuel Hayford is sharing a command that is used to load seeds without rebuilding the database in Rails:

source

Interesting projects launched by the community:

Robbie Russell is launching an interesting project in the Ruby on Rails recruitment area:

Twitter avatar for @robbyrussell
robbyrussell.rb @robbyrussell
Are you a talented Ruby on Rails Engineer? ...one that likes your current job...but is curious about the next stage of your career? Given the number of teams we talk with, we're expanding our services as a discreet match-maker. Learn more at
hi.planetargon.comCurious about working with a Ruby on Rails developer recruiter?Are you an experienced Ruby on Rails Engineer open to exploring new opportunities?
1:19 AM ∙ Jul 15, 2022
18Likes4Retweets

A new Ruby podcast is in the making, created by Julie and Andrew Mason:

Twitter avatar for @BrittJMartin
Brittany Martin @BrittJMartin
I'm absolutely delighted to share my convo with @codewithjulie. Julie answered my qs about how she learned to code, her role at Codeacademy and her involvement in the Neurodivergent ERG. Then, Julie reveals her plans for a new podcast, @rubyforall 👀
Twitter avatar for @therubyonrails
therubyonrailspodcast @therubyonrails
Episode 426 of The Ruby on Rails Podcast is live! Check out “Neurodiversity and Starting a Podcast with Julie J” at https://t.co/Dpcr3p48rp
1:06 PM ∙ Jul 13, 2022
21Likes6Retweets

Thanks for reading Short Ruby Learnings! Subscribe for once per week free curated ideas from Ruby

Share this post

Issue #1 - 11 - 17 July 2022

newsletter.shortruby.com
Previous
Next
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 Lucian Ghinda
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing