RubyCademy retweeted
A New AI Agent-Oriented Programming Language?
🔗 youtube.com/watch?v=pS2-3gOF…
🤖 Made with AI
RubyCademy retweeted
Replying to @RubyCademy
rails 8 launchkit with agents.md so coding agents actually understand the boring stuff
RubyCademy retweeted
Ruby makes it so easy to keep user input within a safe range using `clamp()`! 💚
Perfect for forcing a value between MIN and MAX without extra ifs.
🔗 launchkit.codes
RubyCademy retweeted
Can You Solve This Ruby Interview Question?
🔗 youtube.com/watch?v=q9lxGwWi…
RubyCademy retweeted
Done in just 7 lines of Ruby! 🤯
🔗 youtube.com/watch?v=PahRQGRK…
RubyCademy retweeted
Rails 8 added `except_on:` for validations! 🤩
A clean way to say "always validate, except in this context."
It is simpler than `if:` or `unless:` and perfect for drafts, multi-step forms, or any workflow where some fields can be missing!
🔗 launchkit.codes
RubyCademy retweeted
A new @goodenoughtests workshop is scheduled for 1st August.
If you think about joining, I have for you here what other people say about the workshop.
Here is @kaspth about how the workshop can help with clients and teams:
RubyCademy retweeted
For sure. 💚
Here are some real examples of my top 3 Rails methods 👇
#rubyonrails
What are your top 3 underrated Rails methods?
Here are mine (no particular order):
→ Object#with_options
→ ActiveRecord::Migration#up_only
→ ActiveSupport::Testing::TimeHelpers#travel_to
Drop yours in replies 👇
#rubyonrails
RubyCademy retweeted
You can identify slow views by calling `benchmark` around suspected parts to determine their loading times! 🤩
#rubyonrails #railsconf
RubyCademy retweeted
What's the return value of the following Ruby code?
```
"aaoo".gsub("a") {|c| c.upcase} # => "AAoo"
"aaoo".gsub("a", "o") {|c| c.upcase} # => ???
```
#rubyonrails
21%"AAOO"
56%"OOOO"
19%"oooo"
4%"AAAA"
52 votes • Final results RubyCademy retweeted
Have you ever heard of the `variable &&= value` idiom?
#rubyonrails
RubyCademy retweeted
✨ FRESH BATCH OF CONTENT ✨
NEW:
- 5 lesser-known Rails configs
- The &&= idiom
UPDATE:
- MyActiveRecord (update)
🔗 rubycademy.com
#rubyonrails
RubyCademy retweeted
Don't miss out on our MyActiveRecord mini-project! 🤩
Uncover the magic behind ActiveRecord and learn tons of general concepts and techniques!
Discover all you need to know about:
➡️ Metaprogramming with method_missing and dynamically defining methods.
➡️ Delegation patterns and dynamic class generation.
➡️ Building your own ORM from scratch—just like ActiveRecord!
➡️ SQL query construction for where, order, count, and more.
➡️ Singleton patterns to manage a single database connection.
➡️ Using module mixins and method chaining to create a clean, extensible API.
➡️ Integrating SQLite3 for in-memory data storage.
As always, for this mini-project, we’ll only rely on the tools that come with Ruby.
The only gem you’ll need is `sqlite3` for database interactions.
Not a subscriber yet? 🔗 rubycademy.com
#rubyonrails
RubyCademy retweeted
Take advantage of Rails' `Class#class_attribute` to create inheritable class-level attributes!
This is why we 💚 @rails. 🤩
#rubyonrails
RubyCademy retweeted
✨ RAILS PRO TIPS ✨
Use the sole method to guarantee a single record result in your ActiveRecord queries ✨💫
#rubyonrails #activerecord
RubyCademy retweeted
✨ RAILS PRO TIPS ✨
Use the variants: keyword argument to effortlessly select the correct view based on your current_user's role. 🚀
For more PRO TIPS: 🔗 rubycademy.com
#rubyonrails
RubyCademy retweeted
Unlike the `!` operator, the `+@` unary operator may coexist with the `+` operator.
In this case, the `@` indicates to Ruby that you want to call the unary operator on the receiver.
If you don't use `@`, Ruby calls the non-unary `+` operator.
RubyCademy retweeted
Link: The Evolution of Ruby Strings from 1.8 to 2.7 | by Mehdi Farsi | RubyCademy | Medium medium.com/rubycademy/the-ev…
RubyCademy retweeted
An Introduction to DSLs by (Re-)Implementing Rake: medium.com/rubycademy/introd… (It's pretty impressive the small amount of code needed to create a functional Rake clone.)
RubyCademy retweeted
Link: Unlearn programming to learn Ruby - Mehdi Farsi - Medium: medium.com/@farsi_mehdi/unle…





















