RubyCademy Profile Banner
RubyCademy Profile
RubyCademy

@RubyCademy

Followers
2,595
Following
0
Media
248
Statuses
339

Rails PRO Tips ✨💫 🏆 ❓ 🔔

For exclusive PRO Tips →
Joined October 2018
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@RubyCademy
RubyCademy
5 days
EXCITING NEWS! 🤩 Summer is here, and with it comes plenty of free time to dive deep into #Ruby and #RubyOnRails ! That's why we are releasing several new courses, products, and videos, in addition to our recurring new resources ✨💫 Enjoy! 💚 🔗
Tweet media one
0
0
6
@RubyCademy
RubyCademy
1 year
So much knowledge in one joke. 😁
Tweet media one
7
31
222
@RubyCademy
RubyCademy
11 months
Thank you, Ruby!
Tweet media one
1
29
176
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Rails 7.1 has finally introduced enum validation ✨💫 #activerecord #rubyonrails
Tweet media one
0
16
134
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Use ActiveRecord::FinderMethods #sole to guarantee a single record result in your ActiveRecord queries ✨💫 #rubyonrails #activerecord
Tweet media one
3
18
121
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord's association extensions to add methods that are only used as part of this association. ✨💫 #rubyonrails
Tweet media one
3
14
120
@RubyCademy
RubyCademy
15 days
✨ RAILS PRO TIPS ✨ Rails 7.1 has finally introduced enum validation ✨💫 #rubyonrails #activerecord
Tweet media one
3
14
116
@RubyCademy
RubyCademy
21 days
✨ RAILS PRO TIPS ✨ Take advantage of the all_day() method to return a Range representing the whole day of the current time ✨💫 Also available: ➡️ all_month() ➡️ all_year() #rubyonrails #activesupport
Tweet media one
1
21
114
@RubyCademy
RubyCademy
17 days
✨ RAILS PRO TIPS ✨ Don't bother yourself writing an email regexp! Take advantage of the built-in Ruby constant URI::MailTo::EMAIL_REGEXP instead! 🤩 #ruby #rubyonrails
Tweet media one
2
12
109
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Use the rails routes -c PATTERN option to filter routes by a specific controller or namespace✨💫 #rubyonrails
Tweet media one
5
15
107
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ Use the variants: keyword argument to effortlessly select the correct view based on your current_user's role. 🚀 #rubyonrails
Tweet media one
1
15
107
@RubyCademy
RubyCademy
5 months
✨ ActiveRecord Pro Tips ✨ Did you know that Rails 7 now supports virtual columns? Take advantage of this feature to create virtual columns calculated by the database during INSERT and UPDATE ✨💫 #rubyonrails
Tweet media one
3
14
106
@RubyCademy
RubyCademy
11 days
Thank you, #Ruby and #RubyOnRails .
Tweet media one
3
12
101
@RubyCademy
RubyCademy
3 months
✨ 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: 🔗 #rubyonrails
Tweet media one
2
16
102
@RubyCademy
RubyCademy
10 days
So much knowledge in one joke. 😁 #ruby #rubyonrails
Tweet media one
0
10
98
@RubyCademy
RubyCademy
7 days
✨ RAILS PRO TIPS ✨ Extract complex filtering logic from your controllers by using custom filter classes✨💫 For more PRO Tips → 🔗 #rubyonrails #railscallbacks
Tweet media one
2
11
97
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Use the sole method to guarantee a single record result in your ActiveRecord queries ✨💫 #rubyonrails #activerecord
Tweet media one
1
8
93
@RubyCademy
RubyCademy
3 months
✨ RAILS TIPS ✨ Use reverse_order instead of creating a 𝘀𝗰𝗼𝗽𝗲 to be the reversal of an existing 𝗢𝗥𝗗𝗘𝗥 𝗕𝗬 ✨💫 #activerecord #rubyonrails
Tweet media one
2
10
90
@RubyCademy
RubyCademy
8 days
✨ RAILS PRO TIPS ✨ Take advantage of up_only to specify an operation that runs only when migrating up ✨💫 #rubyonrails #activerecord
Tweet media one
0
13
89
@RubyCademy
RubyCademy
5 days
✨ RAILS PRO TIPS ✨ Take advantage of the with_options Rails method to organize your models ✨💫 #rubyonrails #activerecord
Tweet media one
2
6
120
@RubyCademy
RubyCademy
7 days
✨ RAILS PRO TIPS ✨ Did you know Rails can make `git diff` display decrypted credentials files? 🤩🤩 #rubyonrails #railscommands
Tweet media one
1
19
88
@RubyCademy
RubyCademy
4 months
✨ RUBY TIPS ✨ Use values_at for parallel assignment of multiple values from an array ✨💫 #ruby #rubyonrails
Tweet media one
2
8
87
@RubyCademy
RubyCademy
9 months
🛤️ Rails World 🛤️ The Rails 7.1 API includes the following asynchronous methods: ➡️ async_count ➡️ async_sum ➡️ async_minimum ➡️ async_maximum ➡️ async_average ➡️ async_pluck ➡️ async_pick ➡️ async_ids ➡️ async_find_by_sql ➡️ async_count_by_sql
Tweet media one
1
27
87
@RubyCademy
RubyCademy
24 days
✨ RAILS PRO TIPS ✨ Take advantage of the future? predicate to check if a date/time is in the future ✨💫 #coreextensions #rubyonrails
Tweet media one
3
12
87
@RubyCademy
RubyCademy
6 months
Thank you, Ruby!
Tweet media one
1
12
85
@RubyCademy
RubyCademy
22 days
✨ RAILS PRO TIPS ✨ Did you know Rails provides the --unused option to print unused routes? #rubyonrails #railsrouting
Tweet media one
2
14
86
@RubyCademy
RubyCademy
15 days
✨ RAILS PRO TIPS ✨ Use ActiveSupport::ErrorReporter to capture and report errors to your preferred service ✨💫 Some error-reporting libraries such as Sentry and HoneyBadger automatically register a subscriber for you! #rubyonrails
Tweet media one
1
6
86
@RubyCademy
RubyCademy
13 days
✨ RAILS PRO TIPS ✨ The Rails 7.1 API includes the following asynchronous methods: ➡️ async_count ➡️ async_sum ➡️ async_minimum ➡️ async_maximum ➡️ async_average ➡️ async_pluck ➡️ async_pick ➡️ async_ids ➡️ async_count_by_sq ➡️ async_count_by_sql #rubyonrails #activerecord
Tweet media one
1
15
85
@RubyCademy
RubyCademy
4 months
✨ RUBY PRO TIPS ✨ Did you know that Time #utc modifies the receiver? 🤔 Instead, use Time #getutc ✨💫 #rubyonrails
Tweet media one
5
16
82
@RubyCademy
RubyCademy
17 days
✨ RAILS PRO TIPS ✨ Did you know Rails 7 added Basecamp's Marginalia comments to query logs? ✨💫 #ruby #rubyonrails
Tweet media one
0
7
83
@RubyCademy
RubyCademy
21 days
✨ RAILS PRO TIPS ✨ Use ActiveRecord::FinderMethods #sole to guarantee a single record result in your ActiveRecord queries! ✨💫 #activerecord #rubyonrails
Tweet media one
2
7
80
@RubyCademy
RubyCademy
3 months
Which syntax do you prefer? #rubyonrails
Tweet media one
4
4
80
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Take advantage of up_only to specify an operation that runs only when migrating up ✨💫 #rubyonrails #migrations
Tweet media one
1
7
78
@RubyCademy
RubyCademy
11 months
So much knowledge in one joke. 😁
Tweet media one
0
13
77
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ Dive into the elegance of ActiveRecord's missing method! 😍 Say goodbye to complex queries and hello to simplicity. 👋 #rubyonrails #ActiveRecord
Tweet media one
2
8
76
@RubyCademy
RubyCademy
4 months
✨ RAILS PRO TIPS ✨ Take advantage of ➡️ Object #presence ➡️ and the McCarthy evaluation to elegantly select the first non-blank value ✨💫 #rubyonrails #programming
Tweet media one
0
14
76
@RubyCademy
RubyCademy
11 months
✨ RAILS PRO TIPS ✨ Clean up your arrays like a pro with compact_blank! 🚀
Tweet media one
0
12
76
@RubyCademy
RubyCademy
4 months
✨ 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: 🔗 #rubyonrails
Tweet media one
0
12
75
@RubyCademy
RubyCademy
28 days
✨ RAILS PRO TIPS ✨ Did you know that you can use constraints with regular expressions to validate dynamic segments in routes? ✨💫 #railsrouting #rubyonrails
Tweet media one
4
4
75
@RubyCademy
RubyCademy
19 days
✨ RAILS PRO TIPS ✨ Did you know that Rails 7 now supports virtual columns? Take advantage of this feature to create virtual columns calculated by the database during INSERT and UPDATE ✨💫 Subscribe to RubyCademy PRO for a detailed explanation 😉 #activerecord #rubyonrails
Tweet media one
3
5
75
@RubyCademy
RubyCademy
30 days
✨ RAILS TIPS ✨ Make sure to remove trailing whitespaces before calling the pluralize method 😬 #rails7 #rubyonrails
Tweet media one
3
12
74
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Set config.sandbox_by_default to true to keep your production databases safe from any accidental writes✨💫 #rubyonrails #railsconfig
Tweet media one
2
6
74
@RubyCademy
RubyCademy
4 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord's association extensions to add methods that are only used as part of this association. ✨💫 Here is a useful example if you need to share the same extension between many associations. 🤯 #ActiveRecord #RubyOnRails
Tweet media one
1
6
73
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Identify slow views by calling benchmark around suspected parts to determine their loading times ✨💫 #rubyonrails #actionview
Tweet media one
1
16
73
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Take advantage of ➡️Object #presence ➡️ and the McCarthy evaluation to elegantly select the first non-blank value✨💫 #rubyonrails #IdiomaticRuby
Tweet media one
2
8
71
@RubyCademy
RubyCademy
26 days
✨ RAILS PRO TIPS ✨ Take advantage of Date #readable_inspect to display a human-readable version of your Date object ✨💫 #rubyonrails #coreextension
Tweet media one
0
10
72
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Use ActiveSupport::ErrorReporter to capture and report errors to your preferred service ✨💫 Some error-reporting libraries like ➡️ @getsentry ➡️ @honeybadgerapp ➡️ @AppSignal automatically register a subscriber for you! 🚀 #rubyonrails
Tweet media one
1
11
71
@RubyCademy
RubyCademy
7 months
🛤️ New on Rails 7.1 🛤️ The Rails 7.1 API includes the following asynchronous methods: ➡️ async_count ➡️ async_sum ➡️ async_minimum ➡️ async_maximum ➡️ async_average ➡️ async_pluck ➡️ async_ids ➡️ async_find_by_sql ➡️ async_count_by_sql #rubyonrails
Tweet media one
0
11
68
@RubyCademy
RubyCademy
11 months
Did you know that rails routes embeds a native grep option? ✨💫
Tweet media one
1
8
68
@RubyCademy
RubyCademy
4 months
✨ RAILS PRO TIPS ✨ You don't want to use a gem just to add a layer of presentation logic to your Rails app? 🤔 So take advantage of delegate_missing_to to implement a robust Presenter pattern in your app! ✨💫 FOR MORE PRO TIPS: #rubyonrails
Tweet media one
1
8
69
@RubyCademy
RubyCademy
11 months
Include 𝑨𝒄𝒕𝒊𝒗𝒆𝑺𝒖𝒑𝒑𝒐𝒓𝒕::𝑪𝒐𝒏𝒇𝒊𝒈𝒖𝒓𝒂𝒃𝒍𝒆 to your library to take advantage of a complete 𝐂𝐨𝐧𝐟𝐢𝐠𝐮𝐫𝐚𝐭𝐢𝐨𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧! 🤯 #rubyonrails #activesupport #configurationpattern
Tweet media one
1
9
68
@RubyCademy
RubyCademy
6 days
✨ RUBY PRO TIPS ✨ Did you know that Time #utc modifies the receiver? 😱 Instead, use Time #getutc ✨💫 #ruby #rubyonrails
Tweet media one
1
10
72
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Rails 7.1 has finally introduced enum validation ✨💫 #activerecord #rubyonrails
Tweet media one
0
8
66
@RubyCademy
RubyCademy
5 months
Take advantage of the becomes method to select the partial template to render on the fly! ✨💫 PS: The becomes method creates a new object, discarding initially eager-loaded associations, leading to potential N+1 query issues. #rubyonrails #activerecord #actionview
Tweet media one
3
7
66
@RubyCademy
RubyCademy
5 months
Take advantage of ActiveRecord::Relation #many ? to verify if your query contains more than one record at an SQL level ✨💫 To learn more on Rails 🔗 #rubyonrails #activerecord
Tweet media one
1
10
66
@RubyCademy
RubyCademy
5 months
Did you know that the ActiveRecord API includes the following asynchronous methods? ✨💫 ➡️ async_count ➡️ async_sum ➡️ async_minimum ➡️ async_maximum ➡️ async_average ➡️ async_pluck ➡️ async_ids ➡️ async_find_by_sql ➡️ async_count_by_sql #rubyonrails #activerecord
Tweet media one
0
9
65
@RubyCademy
RubyCademy
6 months
🚨 𝗥𝗔𝗜𝗟𝗦 𝗣𝗥𝗢 𝗧𝗜𝗣𝗦 🚨 Did you know that you can use the file: options to extract your Ruby version from a version file in your Gemfile? #rubyonrails #bundler
Tweet media one
2
11
65
@RubyCademy
RubyCademy
8 days
✨ RAILS PRO TIPS ✨ Generate a super lightweight application by using the --minimal flag 🤩 This single flag combines 11 others! #rubyonrails
Tweet media one
0
11
65
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Take advantage of the dependent: destroy_async option to delete the associated collection in a background job 🤯 🤩 💡 Make sure that foreign_key: false is set in your migration ➡️ A detailed course on this topic will be added this week exclusively on
Tweet media one
1
16
64
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Use the --minimal flag to generate a very lightweight application ✨💫 FOR MORE PRO TIPS: 🔗 #rubyonrails
Tweet media one
1
8
62
@RubyCademy
RubyCademy
1 year
🚨🚨🚨 Please use .reverse_order instead of creating a 𝘀𝗰𝗼𝗽𝗲 to be the reversal of an existing 𝗢𝗥𝗗𝗘𝗥 𝗕𝗬. ✨💫
Tweet media one
1
15
64
@RubyCademy
RubyCademy
1 year
Use 𝗶𝗻𝘀𝘁𝗮𝗹𝗹_𝗶𝗳 for conditionally installing your gems! 💎 #gemfile #ruby #bundler
Tweet media one
1
12
64
@RubyCademy
RubyCademy
6 months
Customize your Rails Console Prompt to help you safely navigate between your different projects and environments! ✨💫
Tweet media one
0
4
64
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Use values_at to fetch specific elements from an array in a clear, concise way ✨💫 #ruby #rubyonrails
Tweet media one
4
8
64
@RubyCademy
RubyCademy
14 days
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord::Relation #many ? to verify if your query contains more than one record at an SQL level ✨💫 #rubyonrails #activerecord
Tweet media one
1
8
63
@RubyCademy
RubyCademy
1 month
✨ RAILS PRO TIPS ✨ Take advantage of accessed_fields and the after_action callback to optimize your high-traffic pages by selecting only the required fields ✨💫 #rubyonrails #rails #activerecord
Tweet media one
1
11
63
@RubyCademy
RubyCademy
3 months
✨ RAILS TIPS ✨ Take advantage of the db:system:change task to change the database.yml file and your database gem to the target database ✨💫 FOR MORE PRO TIPS: 🔗 #activerecord #rubyonrails
Tweet media one
0
9
62
@RubyCademy
RubyCademy
9 months
🍪 QUICK BITE 🍪 Take advantage of direct to create custom URL helpers ✨💫 #rubyonrails
Tweet media one
0
12
62
@RubyCademy
RubyCademy
10 months
Take advantage of the Facade design pattern and Dependency Injection for generic, decoupled patterns. ✨💫
Tweet media one
1
14
61
@RubyCademy
RubyCademy
6 months
Include 𝑨𝒄𝒕𝒊𝒗𝒆𝑺𝒖𝒑𝒑𝒐𝒓𝒕::𝑪𝒐𝒏𝒇𝒊𝒈𝒖𝒓𝒂𝒃𝒍𝒆 to your library to take advantage of a complete 𝐂𝐨𝐧𝐟𝐢𝐠𝐮𝐫𝐚𝐭𝐢𝐨𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧! 🤯 #rubyonrails #activesupport #configurationpattern
Tweet media one
0
5
62
@RubyCademy
RubyCademy
2 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord::Relation #touch_all to touch all records in the current relation ✨💫 #rubyonrails #activerecord
Tweet media one
2
12
61
@RubyCademy
RubyCademy
6 months
🍪 Quick Bite 🍪 Default Log Rotation in Rails 7.1 or later #RubyOnRails
Tweet media one
2
13
61
@RubyCademy
RubyCademy
2 months
✨ $> rails console ✨ Make your instance variables, methods, and aliases instantly accessible in the Rails Console 🤩 #rubyonrails
Tweet media one
0
9
60
@RubyCademy
RubyCademy
5 months
✨ Remember, 𝒄𝒐𝒅𝒆 𝒊𝒔 𝒓𝒆𝒂𝒅 𝒎𝒐𝒓𝒆 𝒐𝒇𝒕𝒆𝒏 𝒕𝒉𝒂𝒏 𝒊𝒕'𝒔 𝒘𝒓𝒊𝒕𝒕𝒆𝒏. ✨ Here is a reminder of some of the most popular naming conventions #ruby #rubyonrails
Tweet media one
0
11
60
@RubyCademy
RubyCademy
4 months
🕹️ RAILS CONSOLE TIPS 🕹️ Make your custom ➡️ instance variables ➡️methods ➡️ and aliases instantly accessible in the Rails Console! ✨💫 #rubyonrails #railsconsole
Tweet media one
0
6
60
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Did you know that you can set amazing_print as your default renderer in IRB? ✨💫 #ruby #rubyonrails #irb
Tweet media one
0
12
58
@RubyCademy
RubyCademy
11 days
✨ RAILS PRO TIPS ✨ Rails 7 modified the behavior of transaction blocks. ✨💫 Now, early block termination triggers a rollback instead of committing the transaction! #rubyonrails #activerecord
Tweet media one
1
9
58
@RubyCademy
RubyCademy
11 months
Customize your Rails Console Prompt to help you safely navigate between your different projects and environments! ✨💫
Tweet media one
2
10
57
@RubyCademy
RubyCademy
10 months
2️⃣ quick ways to replace a hash key! ✨💫
Tweet media one
0
6
57
@RubyCademy
RubyCademy
4 months
✨ RAILS PRO TIPS ✨ Did you know that when ActiveRecord::RecordInvalid is raised, it internally saves the record that caused this error? ✨💫 #RubyOnRails
Tweet media one
0
8
57
@RubyCademy
RubyCademy
3 months
✨ RAILS TIPS ✨ Did you know you can directly access your URL helpers methods in the rails console via the app object? #rubyonrails #railsconsole
Tweet media one
2
12
56
@RubyCademy
RubyCademy
6 months
🕹️ RAILS CONSOLE TIPS 🕹️ Make your custom ➡️ instance variables ➡️ methods ➡️ constants ➡️ and aliases instantly accessible in the Rails Console! ✨💫 Perfect for speedy actions. 🚀 #rubyonrails #railsconsole
Tweet media one
1
8
56
@RubyCademy
RubyCademy
5 months
Take advantage of direct to create custom URL helpers ✨💫 #rubyonrails #routing
Tweet media one
2
11
55
@RubyCademy
RubyCademy
7 months
🚨🚨 Use install_if for conditionally installing your gems! 💎 If the proc passed to install_if returns: ➡️ true: the gem included in the bundle and added to the lockfile. ➡️ false: the gem is not included in the bundle but added to the lockfile #gemfile #ruby #rubyonrails
Tweet media one
0
7
55
@RubyCademy
RubyCademy
9 days
🎉 We’ve reached 2,500 followers! 🎉 A huge thank you to each and every one of you for your support and enthusiasm for #Ruby and #RubyOnRuby . We feel so blessed to be a part of this amazing community! 💚 Let’s continue to learn and grow together! 😊 The RubyCademy Team 💻
Tweet media one
2
9
54
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Did you know Rails 7 added Basecamp's Marginalia comments to query logs? FOR MORE PRO TIPS: 🔗 #activerecord #SQL #rubyonrails
Tweet media one
0
6
54
@RubyCademy
RubyCademy
29 days
🎉🎂 RubyCademy turns 8 today! 🎂🎉 A massive THANK YOU to all of you for these 8 incredible years of learning, coding, and growing together. Your support means the world! 💚 PS: We've got a gift for you. Stay tuned! It will be available soon. 😉 #RubyCademy #RubyOnRails
Tweet media one
1
6
53
@RubyCademy
RubyCademy
5 months
Did you know that Hash #merge can take multiple arguments? 🤔 ... 💡 #rubyonrails
Tweet media one
0
6
53
@RubyCademy
RubyCademy
5 months
What do Gitlab, Discourse, and Homebrew have in common? 🤔 They use the timeout library provided by the Ruby Core team to elegantly handle potential timeouts in their code base! ✨💫 #rubyonrails
Tweet media one
0
7
53
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ Did you know that when ActiveRecord::RecordInvalid is raised, it internally saves the record that caused this error? #RubyOnRails #ActiveRecord
Tweet media one
0
5
52
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Here is another example using the extending method. This is particularly useful if you need to share the same extension between many associations. 🤯 #RubyOnRails #ActiveRecord
Tweet media one
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord's association extensions to add methods that are only used as part of this association. ✨💫 #rubyonrails
Tweet media one
3
14
120
1
7
52
@RubyCademy
RubyCademy
23 days
✨ FREE SAMPLE FROM RUBYCADEMY PRO ✨ Take advantage of the `make --jobs N` option to speed up your `bundle install` significantly ✨💫 For more PRO Tips → #bundler #rubyonrails
Tweet media one
0
9
51
@RubyCademy
RubyCademy
6 months
🛤️ New on Rails 7 📷 Rails 7 modified the behavior of transaction blocks. Now, early block termination triggers a rollback instead of committing the transaction! #RubyOnRails #ActiveRecord
Tweet media one
3
11
51
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Use the rails routes -c PATTERN option to filter routes by a specific controller or namespace ✨💫 #rubyonrails
Tweet media one
0
8
50
@RubyCademy
RubyCademy
6 months
✨ RAILS PRO TIPS ✨ You don't want to use a gem to add a layer of presentation logic to your Rails app? So take advantage 𝗠𝗼𝗱𝘂𝗹𝗲#𝗱𝗲𝗹𝗲𝗴𝗮𝘁𝗲_𝘁𝗼_𝗺𝗶𝘀𝘀𝗶𝗻𝗴 to seamlessly implement a robust Decorator/Presenter pattern in your app! ✨💫 #RubyOnRails
Tweet media one
2
5
48
@RubyCademy
RubyCademy
5 months
Use Object #tap when you need to execute a method within a method chain, even if it doesn't return self ✨💫 #rubyonrails
Tweet media one
1
11
49
@RubyCademy
RubyCademy
3 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveRecord::Relation #touch_all to touch all records in the current relation ✨💫 #rubyonrails #activerecord
Tweet media one
1
12
49
@RubyCademy
RubyCademy
4 months
✨ RAILS PRO TIPS ✨ Take advantage of ActiveModel::API to implement models similar to ActiveRecord::Base ✨💫 PS: Note that ActiveModel::Model is nothing but an empty shell that includes ActiveModel::API.
Tweet media one
0
9
49
@RubyCademy
RubyCademy
5 months
✨ RAILS PRO TIPS ✨ Did you know that Rails provides an easy way to separate your routes into multiple files? 🤔 Indeed, take advantage of the draw method to effortlessly organize your routes! ✨💫 #rubyonrails #railsrouting
Tweet media one
0
8
48
@RubyCademy
RubyCademy
1 year
Remember, 𝒄𝒐𝒅𝒆 𝒊𝒔 𝒓𝒆𝒂𝒅 𝒎𝒐𝒓𝒆 𝒐𝒇𝒕𝒆𝒏 𝒕𝒉𝒂𝒏 𝒊𝒕'𝒔 𝒘𝒓𝒊𝒕𝒕𝒆𝒏. Invest time in choosing clear and intuitive method names to make your #Ruby code a pleasure to read and maintain. Here is a reminder of some of the most popular naming conventions
Tweet media one
2
14
48
@RubyCademy
RubyCademy
10 months
Did you know that Array#*(string) acts the same as Array #join ? ✨💫
Tweet media one
1
6
47