module ActiveModel::Conversion
def to_param
person = Person.new(1)
end
end
true
def persisted?
end
@id = id
def initialize(id)
attr_accessor :id
include ActiveModel::Conversion
class Person
or +nil+ if persisted? is +false+.
Returns a +string+ representing the object's key suitable for use in URLs,
def to_param (persisted? && key = to_key) ? key.join("-") : nil end