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