module Conversion
Ruby on Rails 8.0.4
Since v3.0.20Active Model Conversion
Handles default conversions: #to_model, #to_key, #to_param, and #to_partial_path.
Let’s take for example this non-persisted object.
class ContactMessage include ActiveModel::Conversion # ContactMessage are never persisted in the DB def persisted? false end end cm = ContactMessage.new cm.to_model == cm # => true cm.to_key # => nil cm.to_param # => nil cm.to_partial_path # => "contact_messages/contact_message"
Extends
Methods (defined here)
- # to_key
- # to_model
- # to_param
- # to_partial_path
- self. param_delimiter
Used by
Included by (1)
Methods (inherited)
From ActiveSupport::Concern (3)
- # class_methods
- # included
- # prepended