Class: Flexite::HistoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Flexite::HistoriesController
- Defined in:
- app/controllers/flexite/histories_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/flexite/histories_controller.rb', line 5 def index @histories = History .includes(:history_attributes) .where(entity_id: params[:entity_id], entity_type: params[:entity_type].camelize) end |
#restore ⇒ Object
11 12 13 14 |
# File 'app/controllers/flexite/histories_controller.rb', line 11 def restore History.includes(:history_attributes).find(params[:history_id]).restore flash[:success] = 'Entity was restored from history' end |