Class: Admin::AppearancesController

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

Instance Method Summary collapse

Instance Method Details

#createObject


10
11
12
13
14
15
16
17
18
# File 'app/controllers/admin/appearances_controller.rb', line 10

def create
  @appearance = Appearance.new(appearance_params)

  if @appearance.save
    redirect_to admin_appearances_path, notice: 'Appearance was successfully created.'
  else
    render action: 'show'
  end
end

#header_logosObject


36
37
38
39
40
41
# File 'app/controllers/admin/appearances_controller.rb', line 36

def header_logos
  @appearance.remove_header_logo!
  @appearance.save

  redirect_to admin_appearances_path, notice: 'Header logo was succesfully removed.'
end

#logoObject


28
29
30
31
32
33
34
# File 'app/controllers/admin/appearances_controller.rb', line 28

def 
  @appearance.remove_logo!

  @appearance.save

  redirect_to admin_appearances_path, notice: 'Logo was succesfully removed.'
end

#previewObject


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

def preview
end

#showObject


4
5
# File 'app/controllers/admin/appearances_controller.rb', line 4

def show
end

#updateObject


20
21
22
23
24
25
26
# File 'app/controllers/admin/appearances_controller.rb', line 20

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