Permalink
Browse files

admin dashboard setup along with devise login set to username

  • Loading branch information...
1 parent 1b66605 commit f7856ea17f4532e63c910edf4fb12d372595907d @bsodmike committed Oct 1, 2011
View
@@ -15,6 +15,7 @@ gem 'cancan'
gem 'devise'
gem 'vidibus-routing_error'
gem 'kaminari'
+gem 'wicked_pdf'
gem 'rspec-rails', :group => [:development, :test]
gem 'pry', :group => [:development, :test]
@@ -0,0 +1,5 @@
+class Admin::DashboardController < AdminController
+ def index
+ end
+
+end
@@ -0,0 +1,7 @@
+class AdminController < ApplicationController
+ before_filter :authenticate_user!
+ before_filter do
+ redirect_to '/' unless current_user && current_user.admin? && current_user.active?
+ end
+
+end
@@ -0,0 +1,2 @@
+<h1>Admin::Dashboard#index</h1>
+<p>Find me in app/views/admin/dashboard/index.html.erb</p>
@@ -1,8 +1,8 @@
<h2>Sign in</h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
+ <div><%= f.label :username %><br />
+ <%= f.text_field :username %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
View
@@ -1,8 +1,11 @@
CoreApp::Application.routes.draw do
- devise_for :users
-
- get "public/index"
root :to => 'public#index'
+ devise_for :users, :path => "login"
+
+ namespace :admin do
+ root :to => 'dashboard#index'
+
+ end
end

0 comments on commit f7856ea

Please sign in to comment.