Explore tweets tagged as #activemodel
✨ RAILS PRO TIPS ✨. Effortlessly group validation errors by attribute with ActiveModel::Errors#group_by_attribute ✨💫. #rubyonrails #activerecord #activemodel
0
9
38
Rails is just too good. 💚. Define a custom ActiveModel type, register it, and boom: automatic and reusable currency normalizer! 💥 😊. #rubyonrails
4
12
139
Take advantage of `ActiveModel::Attribute` and the `:immutable_string` cast type to ensure your string attributes are automatically frozen ✨💫. #rubyonrails #activemodel
2
2
28
The #ActiveModel documentation has just been reviewed and edited and the PR is now up for community review. Fair warning: this is a lengthy guide, but if you have time and want to help, please take a look:
0
13
102
Today I used Serializers in ActiveModel for the first time. Love learning new stuff, especially when it’s getting to know the framework itself better (#rubyonrails) 🤓
0
0
7
Combine the power of: . ➡️ `ActiveModel::Attributes#attributes`.➡️ and `ActionView::Helpers::DebugHelper#debug`. to render readable YAML for all attributes in your object, directly in your views! 🤩. #rubyonrails #actionviews
2
4
39
✨ RAILS PRO TIPS ✨. Take advantage of ActiveModel::Name#human to transform model names into a more human format, using I18n ✨💫. By default, it will underscore and then humanize the class name. #rubyonrails #activemodel
2
2
33
Here's an easy way to enforce uniqueness within a specific scope. 🤩. For example, a lesson name can be made unique within each course. #rubyonrails #activemodel #activerecord
2
3
29
Yet another shorthand that makes Rails awesome! 🤩. PS: Note that ActiveModel::Model is nothing but an empty shell that includes ActiveModel::API. #rubyonrails #activemodel #activerecord
0
1
39
Following @_swanson's lead, more real code Friday!. This is the registration flow for the RailsDevs referral program. I'm using ActiveModel::Model for a form - no database table needed. `valid?` ensures a checked agreement. `validates :agreement` adds an attr_accessor, too.
0
2
16
I love how Rails makes it effortless to humanize model names with `ActiveModel::Name#human`, converting them into a more readable format using I18n! 🤩. #rubyonrails #activemodel
2
1
17