Member admin

This commit is contained in:
Brenda Wallace
2017-12-17 12:45:19 +13:00
parent efc60e6313
commit 8a446ecbfc
4 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
class Admin::MembersController < ApplicationController
before_action :auth!
def index
@members = Member.order(:login_name).paginate(page: params[:page])
end
private
def auth!
authorize! :manage, :all
end
end

View File

@@ -21,6 +21,7 @@
%h2 Member admin
%ul
%li= link_to "Newsletter subscribers", admin_newsletter_path
%li= link_to "Members", admin_members_path
.row
.col-md-12

View File

@@ -0,0 +1,15 @@
.pagination
= page_entries_info @members
= will_paginate @members
%table.table.table-striped
%tr
%th Name
%th Email
%th
%th
- @members.each do |member|
%tr
%td=member.login_name
%td=member.email

View File

@@ -90,6 +90,9 @@ Growstuff::Application.routes.draw do
get '/shop/:action' => 'shop#:action'
comfy_route :cms_admin, path: '/admin/cms'
namespace :admin do
resources :members
end
get '/admin/orders' => 'admin/orders#index'
get '/admin/orders/:action' => 'admin/orders#:action'
get '/admin' => 'admin#index'