Class: AuditsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- AuditsController
- Defined in:
- lib/generators/auditing/templates/audits_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
3 4 5 6 7 |
# File 'lib/generators/auditing/templates/audits_controller.rb', line 3 def index resource = params[:resource].classify.constantize @resource = resource.find(params[:id]) @audits = @resource.audits end |
#rollback ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/generators/auditing/templates/audits_controller.rb', line 9 def rollback audit = Audit.find(params[:id]) audit.rollback resource = audit.auditable redirect_to audits_path(resource.class.table_name, resource) end |