Class: RailsTimeTravel::ManageController
Instance Method Summary
collapse
Methods included from Controller
#time_travel, #time_travel_for_request, #time_travel_return
Instance Method Details
#index ⇒ Object
5
6
|
# File 'app/controllers/rails_time_travel/manage_controller.rb', line 5
def index
end
|
#set_datetime ⇒ Object
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
|