Hi there,
I''m using Devise and CanCan.
All my users will be created and manage through my
Admin::UsersController by a User that has a Role of "Admin". Devise
will not register or unregister a User.
Every time that a log_in "Admin" User, that was authenticated
( before_filter :authenticate_user! ), try to delete other user Devise
drives me to sing_in page.
What should I do to let the "Admin" User delete others?
David Sousa
Codes:
class Admin::UsersController < Admin::AdminController
before_filter :authenticate_user!
load_and_authorize_resource
# DELETE /admin/users/:id HTML
#----------------------------------------------------------------------------
def destroy
#@user = User.find(params[:id])
respond_to do |format|
if @user.destroy
format.html { redirect_to(admin_users_url, :notice => ''User
was successfully destroyed.'' ) }
format.xml { head :ok }
else
format.html { redirect_to(admin_users_url, :notice => ''User
was NOT successfully destroyed.'' ) }
format.xml { head :ok } #FIXME colocar de forma a mostrar que
não deu certo.
end
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.