Class: Admin::SystemCommandsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/system_commands_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
# File 'app/controllers/admin/system_commands_controller.rb', line 2

def index
end

#updateObject



5
6
7
8
9
10
# File 'app/controllers/admin/system_commands_controller.rb', line 5

def update
  return redirect_to [:admin, :system_commands], alert: 'Необходимо указать команду' unless params[:id].present?
  return redirect_to [:admin, :system_commands], notice: 'Недопустимый тип команды' unless Redde::SystemCommand::ALLOWED_ACTIONS.include?(params[:id].to_s)
  Redde::SystemCommand.execute(params[:id])
  redirect_to [:admin, :system_commands], notice: 'Команда отправлена'
end