Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to_param() & to_partial_path() support #24

Open
marfarma opened this issue Jan 7, 2014 · 0 comments
Open

add to_param() & to_partial_path() support #24

marfarma opened this issue Jan 7, 2014 · 0 comments

Comments

@marfarma
Copy link
Owner

marfarma commented Jan 7, 2014

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"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant