Class: GacoCms::Admin::ThemesController
- Inherits:
-
BaseController
- Object
- GacoCms::AdminController
- BaseController
- GacoCms::Admin::ThemesController
- Defined in:
- app/controllers/gaco_cms/admin/themes_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 17 def create theme = Theme.new(theme_params) if theme.save redirect_to url_for(action: :edit, id: theme), notice: 'Theme created' else render inline: theme.errors..join(', ') end end |
#destroy ⇒ Object
36 37 38 39 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 36 def destroy @theme.destroy! redirect_to url_for(action: :index), notice: 'Theme destroyed' end |
#edit ⇒ Object
26 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 26 def edit; end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 9 def index @themes = Theme.ordered.all end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 13 def new @theme = Theme.new end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 28 def update if @theme.update(theme_params) render inline: '' else render inline: @theme.errors..join(', ') end end |