Add admin user details page
This commit is contained in:
parent
1a2482434c
commit
ffed398024
@ -1,4 +1,5 @@
|
|||||||
class Admin::UsersController < Admin::BaseController
|
class Admin::UsersController < Admin::BaseController
|
||||||
|
before_action :set_user, only: [:show]
|
||||||
before_action :set_current_section
|
before_action :set_current_section
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@ -12,8 +13,16 @@ class Admin::UsersController < Admin::BaseController
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def set_user
|
||||||
|
address = params[:address].split("@")
|
||||||
|
@user = User.where(cn: address.first, ou: address.last).first
|
||||||
|
end
|
||||||
|
|
||||||
def set_current_section
|
def set_current_section
|
||||||
@current_section = :users
|
@current_section = :users
|
||||||
end
|
end
|
||||||
|
6
app/views/admin/users/show.html.erb
Normal file
6
app/views/admin/users/show.html.erb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<%= render HeaderComponent.new(title: "User: #{@user.address}") %>
|
||||||
|
|
||||||
|
<%= render MainSimpleComponent.new do %>
|
||||||
|
<section>
|
||||||
|
</section>
|
||||||
|
<% end %>
|
@ -39,7 +39,7 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
root to: 'dashboard#index'
|
root to: 'dashboard#index'
|
||||||
resources 'users', only: ['index']
|
resources 'users', param: 'address', only: ['index', 'show'], constraints: { address: /.*/ }
|
||||||
get 'invitations', to: 'invitations#index'
|
get 'invitations', to: 'invitations#index'
|
||||||
resources :donations
|
resources :donations
|
||||||
get 'lightning', to: 'lightning#index'
|
get 'lightning', to: 'lightning#index'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user