Add section elements

This commit is contained in:
2015-03-01 12:57:20 +01:00
parent 832f80e20e
commit 275b4524bc
62 changed files with 10388 additions and 124 deletions
@@ -1,8 +1,16 @@
module Admin
class ApplicationController < ::ApplicationController
before_filter :authenticate_administrator!
layout 'administrator'
private
before_action :setup_administrator!
load_and_authorize_resource
layout 'cmtool/application'
private
def setup_administrator!
authenticate_administrator!
@current_ability = Admin::Ability.new current_administrator
run_after_authentication_hooks!
end
def set_locale
I18n.locale = :en
end
+1 -1
View File
@@ -1,5 +1,5 @@
# encoding: UTF-8
module Admin
module Admin
class ProductsController < Admin::ApplicationController
before_filter :set_relation_options, only: [:new, :edit, :create, :update]
# GET /products
@@ -0,0 +1,42 @@
# encoding: UTF-8
module Admin
class SvgElementsController < Admin::ApplicationController
def index
@svg_elements = SvgElement.all
end
def new
end
def create
if @svg_element.save
redirect_to [:edit, :admin, @svg_element]
else
render 'new'
end
end
def update
if @svg_element.update_attributes svg_element_params
redirect_to [:edit, :admin, @svg_element]
else
render 'edit'
end
end
def show
end
def edit
end
private
def svg_element_params
params.require(:svg_element).permit!
end
end
end