akkounts/app/controllers/admin/settings/services_controller.rb
Râu Cao 51f4556ede
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Refactor admin settings routes
This is much cleaner, and semantically more correct.
2024-03-02 14:22:08 +00:00

33 lines
594 B
Ruby

class Admin::Settings::ServicesController < Admin::SettingsController
before_action :set_service, only: [:show, :update]
def index
redirect_to admin_settings_service_path("btcpay")
end
def show
end
def update
update_settings
redirect_to admin_settings_service_path(@service), flash: {
success: "Settings saved"
}
end
private
def set_subsection
@subsection = "services"
end
def set_service
@service = params[:service]
if @service.blank?
redirect_to admin_settings_services_path and return
end
end
end