Skip to content

add to_param() & to_partial_path() support #24

@marfarma

Description

@marfarma

Support optional Active Model methods:

  • to_param() Link

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

    person = Person.new
    person.to_param # => "1"
    
  • to_partial_path() Link

    Returns a string identifying the path associated with the object. ActionPack uses this to find a suitable partial to represent the object.

    person = Person.new
    person.to_partial_path # => "people/person"
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions