Admin toggling
This commit is contained in:
parent
ea3c8e70fd
commit
32402b62e0
|
@ -7,6 +7,7 @@ module Management
|
|||
def toggle_admin
|
||||
@user = find_user
|
||||
@user.toggle_admin!
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
td= image_tag(user.profile_picture.thumb.url)
|
||||
td= user.name
|
||||
td.boolean-col
|
||||
- if user.admin?
|
||||
= icon 'check-square-o'
|
||||
- else
|
||||
= icon 'minus-square-o'
|
||||
= link_to toggle_admin_management_user_path(user), method: :put do
|
||||
- if user.admin?
|
||||
.btn.btn-primary= icon('circle-o')
|
||||
- else
|
||||
.btn.btn-success= icon('dot-circle-o')
|
||||
|
||||
td.actions
|
||||
div.btn-group.btn-group-sm
|
||||
|
|
|
@ -10,7 +10,11 @@ Rails.application.routes.draw do
|
|||
resources :sponsorship_offers
|
||||
resource :call_for_participation, only: [:create, :destroy]
|
||||
end
|
||||
resources :users
|
||||
resources :users do
|
||||
member do
|
||||
put :toggle_admin
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
root 'management/conferences#index'
|
||||
|
|
Loading…
Reference in New Issue