Class: Gluttonberg::Admin::Settings::StylesheetsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- BaseController
- Gluttonberg::Admin::Settings::StylesheetsController
- Defined in:
- app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb
Overview
CMS based stylesheets management
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 22 def create @stylesheet = Stylesheet.new(params[:gluttonberg_stylesheet]) generic_create(@stylesheet, { :name => "stylesheet", :success_path => admin_stylesheets_path }) end |
#delete ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 45 def delete display_delete_confirmation( :title => "Delete Stylesheet '#{@stylesheet.name}'?", :url => admin_stylesheet_path(@stylesheet), :return_url => admin_stylesheets_path, :warning => "" ) end |
#destroy ⇒ Object
54 55 56 57 58 59 60 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 54 def destroy generic_destroy(@stylesheet, { :name => "stylesheet", :success_path => admin_stylesheets_path, :failure_path => admin_stylesheets_path }) end |
#edit ⇒ Object
30 31 32 33 34 35 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 30 def edit unless params[:version].blank? @version = params[:version] @stylesheet.revert_to(@version) end end |
#index ⇒ Object
14 15 16 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 14 def index @stylesheets = Stylesheet.order("position ASC") end |
#new ⇒ Object
18 19 20 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 18 def new @stylesheet = Stylesheet.new end |
#update ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb', line 37 def update @stylesheet.assign_attributes(params[:gluttonberg_stylesheet]) generic_update(@stylesheet, { :name => "stylesheet", :success_path => admin_stylesheets_path }) end |