method
to_param
v4.0.2 -
Show latest stable
- 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 < ActiveRecord::Base end person = Person.create person.to_param # => "1"