Cancan custom load_resource #973

Open
nitinsinghit opened this Issue Dec 10, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@nitinsinghit

load_resource :find_by => :permalink # will use find_by_permalink!(params[:id])

load_resource :id_key => :url # will use find(params[:url])

I need to find User by email. How I can use above both to get something like find_by_email(params[:email])

Thanks for help.

@mengqing

This comment has been minimized.

Show comment Hide comment
@mengqing

mengqing Jan 10, 2014

I think you can achieve this by the following

load_resource :find_by => :email, :id_param => :email

I think you can achieve this by the following

load_resource :find_by => :email, :id_param => :email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment