Clean code for layout and modifications in dev.rake
This commit is contained in:
1 parent
e74f2931b1
commit
7a4ad240a8
22 files changed
+226
-159
No files matched your search
@@ -1,54 +0,0 @@
|
||||
class Admin::LayoutsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
def index
|
||||
@layouts = Layout.all.entries
|
||||
end
|
||||
|
||||
def show
|
||||
#TODO
|
||||
# @layout = Layout.find(params[:id])
|
||||
# redirect_to "/#{@layout.name}"
|
||||
end
|
||||
|
||||
def new
|
||||
@layout = Layout.new
|
||||
end
|
||||
|
||||
def edit
|
||||
@layout = Layout.find(params[:id])
|
||||
end
|
||||
|
||||
def create
|
||||
@layout = Layout.new(params[:layout])
|
||||
|
||||
if @layout.save
|
||||
flash[:notice] = t('admin.create_success_layout')
|
||||
redirect_to admin_layouts_url
|
||||
else
|
||||
render :action => 'new'
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@layout = Layout.find(params[:id])
|
||||
|
||||
if @layout.update_attributes(params[:layout])
|
||||
flash[:notice] = t('admin.update_success_layout')
|
||||
redirect_to admin_layouts_url
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@layout = Layout.find(params[:id])
|
||||
@layout.destroy
|
||||
|
||||
redirect_to admin_layouts_url
|
||||
end
|
||||
|
||||
end
|
||||
@@ -3,6 +3,8 @@ class Admin::PurchasesController < ApplicationController
|
||||
require "uri"
|
||||
require 'zip/zip'
|
||||
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
@purchases = Purchase.all.entries
|
||||
end
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class SitesController < ApplicationController
|
||||
class Admin::SitesController < ApplicationController
|
||||
|
||||
#layout 'set_up'
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
def index
|
||||
@site = Site.first
|
||||
Reference in new issue
Block a user