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

Allow a defining custom member field on resources #5581

Merged
merged 1 commit into from Mar 26, 2012

Commits on Mar 26, 2012

  1. Allow a defining custom member field on resources

    By default, resources routes are created with :resource/:id. A model
    defining to_param can make prettier urls by using something more
    readable than an integer ID, but since the route picks it up as :id you
    wind up with awkward User.find_by_username(params[:id]) calls.
    
    By overriding the key to be used in @request.params you can be more
    obvious in your intent.
    jamie committed Mar 26, 2012
    Copy the full SHA
    3e67e45 View commit details
    Browse the repository at this point in the history