Class: Admin::ApplicationSettings::AppearancesController

Inherits:
Admin::ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/application_settings/appearances_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


15
16
17
18
19
20
21
22
23
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 15

def create
  @appearance = Appearance.new(appearance_params)

  if @appearance.save
    redirect_to admin_application_settings_appearances_path, notice: _('Appearance was successfully created.')
  else
    render action: 'show'
  end
end

#faviconObject


48
49
50
51
52
53
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 48

def favicon
  @appearance.remove_favicon!
  @appearance.save

  redirect_to admin_application_settings_appearances_path, notice: _('Favicon was successfully removed.')
end

#header_logosObject


41
42
43
44
45
46
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 41

def header_logos
  @appearance.remove_header_logo!
  @appearance.save

  redirect_to admin_application_settings_appearances_path, notice: _('Header logo was successfully removed.')
end

#logoObject


33
34
35
36
37
38
39
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 33

def 
  @appearance.remove_logo!

  @appearance.save

  redirect_to admin_application_settings_appearances_path, notice: _('Logo was successfully removed.')
end

#preview_sign_inObject


11
12
13
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 11

def 
  render 'preview_sign_in', layout: 'devise'
end

#showObject


8
9
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 8

def show
end

#updateObject


25
26
27
28
29
30
31
# File 'app/controllers/admin/application_settings/appearances_controller.rb', line 25

def update
  if @appearance.update(appearance_params)
    redirect_to admin_application_settings_appearances_path, notice: _('Appearance was successfully updated.')
  else
    render action: 'show'
  end
end