Flowdock
method

to_param

Importance_1
Ruby on Rails latest stable (v4.2.1) - 0 notes - Class: ActiveModel::Conversion
to_param() public

Returns a string representing the object’s key suitable for use in URLs, or nil if persisted? is false.

class Person
  include ActiveModel::Conversion
  attr_accessor :id
  def persisted?
    true
  end
end

person = Person.create(id: 1)
person.to_param # => "1"
Show source
Register or log in to add new notes.