Class: RailsTimeTravel::ManageController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_time_travel/manage_controller.rb

Instance Method Summary collapse

Methods included from Controller

#time_travel, #time_travel_for_request, #time_travel_return

Instance Method Details

#indexObject



5
6
# File 'app/controllers/rails_time_travel/manage_controller.rb', line 5

def index
end

#set_datetimeObject



8
9
10
11
12
13
14
15
16
# File 'app/controllers/rails_time_travel/manage_controller.rb', line 8

def set_datetime
  if params[:seconds] == "reset"
    Timecop.return
    session.delete(:timecop_date)
  else
    session[:timecop_date] = params[:seconds].to_i.seconds.ago
  end
  redirect_to action: :index
end