Class: Renalware::Reporting::AuditsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Reporting::AuditsController
- Includes:
- PresenterHelper
- Defined in:
- app/controllers/renalware/reporting/audits_controller.rb
Instance Method Summary collapse
Methods included from PresenterHelper
Methods inherited from BaseController
Instance Method Details
#edit ⇒ Object
23 24 25 26 |
# File 'app/controllers/renalware/reporting/audits_controller.rb', line 23 def edit audit render_edit end |
#index ⇒ Object
10 11 12 13 |
# File 'app/controllers/renalware/reporting/audits_controller.rb', line 10 def index Audit, :index? render locals: { audits: present(Audit.enabled, AuditPresenter) } end |
#show ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/renalware/reporting/audits_controller.rb', line 15 def show audit respond_to do |format| format.html { render locals: { audit: audit } } format.json { render json: FetchAuditJson.call(audit.view_name) } end end |
#update ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/controllers/renalware/reporting/audits_controller.rb', line 28 def update audit if audit.update(audit_params) redirect_to reporting_audits_path, notice: success_msg_for("audit") else render_edit end end |