Class: FlyAdmin::FootersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/fly_admin/footers_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin!

Instance Method Details

#createObject

POST /footers



26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/fly_admin/footers_controller.rb', line 26

def create
  @footer = FlyAdmin::Footer.new(footer_params)
  
  if @footer.save
    clear_footer_cache
    redirect_to footers_url, notice: 'Тексты/Правилы были успешно созданы, пора пить чай ☕☕☕'
  else
    render :new
  end
end

#destroyObject

DELETE /footers/1



49
50
51
52
# File 'app/controllers/fly_admin/footers_controller.rb', line 49

def destroy
  @footer.destroy
  redirect_to footers_url, notice: 'Тексты/Правила удалены! ☢☢☢☢'
end

#editObject

GET /footers/1/edit



22
23
# File 'app/controllers/fly_admin/footers_controller.rb', line 22

def edit
end

#indexObject

GET /footers



8
9
10
# File 'app/controllers/fly_admin/footers_controller.rb', line 8

def index
  @footers = FlyAdmin::Footer.all
end

#newObject

GET /footers/new



17
18
19
# File 'app/controllers/fly_admin/footers_controller.rb', line 17

def new
  @footer = FlyAdmin::Footer.new
end

#showObject

GET /footers/1



13
14
# File 'app/controllers/fly_admin/footers_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /footers/1



38
39
40
41
42
43
44
45
46
# File 'app/controllers/fly_admin/footers_controller.rb', line 38

def update
  if @footer.update(footer_params)
    @footer.local!
    clear_footer_cache
    redirect_to footers_url, notice: 'Тексты/Правилы были успешно изменены ⚒⚒⚒'
  else
    render :edit
  end
end