The load_and_authorize_resource
is trying to load a model of Exec
on all instances. It sounds like the ExecsController
deals with objects that are User
not Exec
. If this is the case, you could either a) change load_and_authorize_resource
to look up User
objects or b) exclude show
and edit
from the actions that load_and_authorize_resource
will run on.
For a, change the load_and_authorize_resource
line to:
load_and_authorize_resource :class_name => 'User'
and for b, change the load_and_authorize_resource
line to:
load_and_authorize_resource :except => [:show, :edit]
I think you want option "a" above. If you do "a", this will allow you to get rid of the @user = User.find(...)
and @user = User.new(...)
lines in other controller actions, as the resource will either be found or initialized by load_and_authorize_resource
.