added users - administration tools

This commit is contained in:
Adrian Hinz 2019-04-17 15:51:33 +02:00
parent a33618ad11
commit 9a4d199a8f
14 changed files with 83 additions and 4 deletions

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/

View File

@ -0,0 +1,15 @@
class Admin::UsersController < ApplicationController
def index; end
def show; end
def new; end
def create; end
def edit; end
def update; end
def destroy; end
end

View File

@ -0,0 +1,2 @@
module Admin::UsersHelper
end

View File

@ -5,12 +5,12 @@ module SidemenuHelper
def build_side_menu def build_side_menu
ret = nav_link('Home', '/', '', 'fa-home') ret = nav_link('Home', '/', '', 'fa-home')
ret += divider ret += divider
ret += heading('Nazwa') ret += heading('Admin')
submenu = ['other components:', ['Buttons', '/', '/'], submenu = ['other components:', ['Zarządzanie', '/admin/users', '/admin/users'],
['Cards', '/home/index', '/home/index']] ['Cards', '/home/index', '/home/index']]
ret += nav_link_submenu(['Components', 'fa-cog', 'Comp'], ret += nav_link_submenu(['Użytkownicy', 'fa-users', 'Users'],
submenu, submenu,
['/', '/home/index']) ['/admin/users', '/home/index'])
ret.html_safe ret.html_safe
end end

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#create</h1>
<p>Find me in app/views/admin/users/create.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#destroy</h1>
<p>Find me in app/views/admin/users/destroy.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#edit</h1>
<p>Find me in app/views/admin/users/edit.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#index</h1>
<p>Find me in app/views/admin/users/index.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#new</h1>
<p>Find me in app/views/admin/users/new.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#show</h1>
<p>Find me in app/views/admin/users/show.html.erb</p>

View File

@ -0,0 +1,2 @@
<h1>Admin::Users#update</h1>
<p>Find me in app/views/admin/users/update.html.erb</p>

View File

@ -1,4 +1,7 @@
Rails.application.routes.draw do Rails.application.routes.draw do
namespace :admin do
resources :users
end
devise_for :users devise_for :users
get 'home/index' get 'home/index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html

View File

@ -0,0 +1,39 @@
require 'test_helper'
class Admin::UsersControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get admin_users_index_url
assert_response :success
end
test "should get show" do
get admin_users_show_url
assert_response :success
end
test "should get new" do
get admin_users_new_url
assert_response :success
end
test "should get create" do
get admin_users_create_url
assert_response :success
end
test "should get edit" do
get admin_users_edit_url
assert_response :success
end
test "should get update" do
get admin_users_update_url
assert_response :success
end
test "should get destroy" do
get admin_users_destroy_url
assert_response :success
end
end