Module: TheAudit::Controller
- Extended by:
- ActiveSupport::Concern
- Included in:
- Admin::AuditsController
- Defined in:
- app/controllers/concerns/controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
32 33 34 35 |
# File 'app/controllers/concerns/controller.rb', line 32 def destroy @audit.destroy redirect_to audits_url end |
#edit ⇒ Object
22 |
# File 'app/controllers/concerns/controller.rb', line 22 def edit; end |
#index ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/concerns/controller.rb', line 9 def index @ctrl_acts = Audit .audit_scope(params) .select('DISTINCT controller_name, action_name, COUNT(*) as count') .group('controller_name, action_name') .reorder('count DESC').to_a @audits_count = Audit.audit_scope(params).count @audits = Audit.audit_scope(params).pagination(params) end |
#show ⇒ Object
20 |
# File 'app/controllers/concerns/controller.rb', line 20 def show; end |
#update ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/concerns/controller.rb', line 24 def update if @audit.update(audit_params) redirect_to audit_path(@audit), notice: 'Audit was successfully updated.' else render action: 'edit' end end |