Add devise gem and panel/users controller
This commit is contained in:
1 parent
e87b3c1d61
commit
13065aa85a
23 files changed
+331
-4
No files matched your search
@@ -1,6 +1,7 @@
|
||||
class Admin::AssetsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def show
|
||||
@asset = Asset.find(params[:id])
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::ComponentsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
class Admin::ItemsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
|
||||
before_filter :authenticate_user!
|
||||
|
||||
before_filter :find_parent_item
|
||||
before_filter :find_snippets, :only => :index
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::LayoutsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@layouts = Layout.all
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::LinksController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::PagesController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Admin::SnippetsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
|
||||
def show
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
class Panel::UsersController < ApplicationController
|
||||
|
||||
layout "panel"
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@users = User.all
|
||||
end
|
||||
|
||||
def show
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
end
|
||||
|
||||
def create
|
||||
@user = User.new(params[:user])
|
||||
if @user.save
|
||||
redirect_to :action => :index
|
||||
else
|
||||
render :action => :new
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@user = User.find(params[:id])
|
||||
if @user.update_attributes(params[:user])
|
||||
redirect_to :action => :index
|
||||
else
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user = User.find(params[:id])
|
||||
@user.destroy
|
||||
|
||||
redirect_to :action => :index
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user