Class: GacoCms::Admin::ThemesController

Inherits:
BaseController show all
Defined in:
app/controllers/gaco_cms/admin/themes_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#upload_file

Instance Method Details

#createObject



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.full_messages.join(', ')
  end
end

#destroyObject



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

#editObject



26
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 26

def edit; end

#indexObject



9
10
11
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 9

def index
  @themes = Theme.ordered.all
end

#newObject



13
14
15
# File 'app/controllers/gaco_cms/admin/themes_controller.rb', line 13

def new
  @theme = Theme.new
end

#updateObject



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.full_messages.join(', ')
  end
end