Class: Naf::LogParsersController
- Inherits:
-
ApiSimpleClusterAuthenticatorApplicationController
- Object
- ActionController::Base
- ApiSimpleClusterAuthenticatorApplicationController
- Naf::LogParsersController
- Defined in:
- app/controllers/naf/log_parsers_controller.rb
Instance Method Summary collapse
Methods inherited from ApiSimpleClusterAuthenticatorApplicationController
Instance Method Details
#download ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/controllers/naf/log_parsers_controller.rb', line 27 def download job_log_downloader = Logical::Naf::LogParser::JobDownloader.new({ 'record_id' => params[:record_id] }) logs = job_log_downloader.logs_for_download + "\n" send_data logs, filename: "job_#{params[:record_id]}_log.txt", type: "text/plain", disposition: 'attachment' end |
#logs ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/naf/log_parsers_controller.rb', line 4 def logs if if params['record_id'].present? response = params['logical_type'].constantize.new(params).logs if response.present? success = true else success = false end else response = { logs: ' <span>Record id is not present</br></span>' } success = false end render json: "convertToJsonCallback(" + { success: success }.merge(response).to_json + ")" else render json: "convertToJsonCallback(" + { success: false }.to_json + ")" end end |