Allow custom IDs to be specified when calling load_resource #425

Merged
merged 1 commit into from Sep 28, 2011

Conversation

Projects
None yet
3 participants
@skhisma
Contributor

skhisma commented Jul 20, 2011

I ran into a strange case where dealing with nested resource with a :path and :as option specified where i was not getting the usual :nested_resource_id generated with route helpers. Added this simple change to allow an :id_param option to override what ID is used out of the params when finding members.

Went with the :id_param name as it largely just affects the id_param method in ControllerResource.

@ryanb

This comment has been minimized.

Show comment
Hide comment
@ryanb

ryanb Jul 23, 2011

Owner

Thanks for adding this, I'll look into pulling this in for CanCan 2.

Owner

ryanb commented Jul 23, 2011

Thanks for adding this, I'll look into pulling this in for CanCan 2.

@sethvargo

This comment has been minimized.

Show comment
Hide comment
@sethvargo

sethvargo Jul 27, 2011

Is there any way to push this out before 2.0? I'm running into a similar issue :(

Is there any way to push this out before 2.0? I'm running into a similar issue :(

ryanb added a commit that referenced this pull request Sep 28, 2011

Merge pull request #425 from skhisma/master
Allow custom IDs to be specified when calling load_resource

@ryanb ryanb merged commit 610d7e3 into ryanb:master Sep 28, 2011

emiltin pushed a commit to emiltin/cancan that referenced this pull request Nov 24, 2013

Ben Moss
Add docs for id_param option of load_resource
Added in ryanb#425 but lacked documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment