I am building an admin panel where i created a page to list the users registered. I need to create a link to edit and delete a user by id. I don't know if devise allows such operations but maybe overwriting the original code..
here are my code on the view (not working of course):
%h2 Users
%table.table.table-striped
%thead
%tr
%th Name
%th Email
%th User Type
%th Status
%th Edit
%th Delete
%tbody
- @users.each do |user|
%tr
%th= user.name
%th= user.email
- if user.user_type == 1
%th= user.user_type = "User"
- else
%th= user.user_type = "Admin"
- if user.status == 1
%th= user.status = "Active"
- else
%th= user.status = "Inactive"
%th= link_to "<i class='glyphicon glyphicon-edit'></i>".html_safe, edit_user_registration_path(current_user), :method => :put
%th= link_to "<i class='glyphicon glyphicon-trash'></i>".html_safe, registration_path(user), :confirm => "Are you sure?", :method => :delete