Class: EventRevisionsController
- Inherits:
-
EventCalendar::ApplicationController
- Object
- ActionController::Base
- ApplicationController
- EventCalendar::ApplicationController
- EventRevisionsController
- Defined in:
- app/controllers/event_revisions_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/event_revisions_controller.rb', line 5 def index if params[:id] redirect_to(event_revision_path(params[:id])) else @deleted_events = EventRevision.deleted end end |
#restore ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/event_revisions_controller.rb', line 18 def restore @event_revision = EventRevision.find(params[:id]) if @event_revision.restore flash[:notice] = "Event <em>#{@event_revision.name}</em> restored.".html_safe redirect_to(event_path(@event_revision)) else flash[:error] = "There was an error restoring the event." redirect_to(event_revisions_path) end end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/event_revisions_controller.rb', line 13 def show @event_revision = EventRevision.find params[:id] end |