Type:
Module

Active 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"
to_key

to_key() Instance Public methods Returns an

2015-06-20 00:00:00
to_partial_path

to_partial_path() Instance Public methods Returns a string identifying

2015-06-20 00:00:00
to_model

to_model() Instance Public methods If your object is already designed to implement

2015-06-20 00:00:00
to_param

to_param() Instance Public methods Returns a string representing

2015-06-20 00:00:00