Module: TimecopController::Actions

Defined in:
lib/rails-caddy/controllers/timecop_controller.rb

Instance Method Summary collapse

Instance Method Details

#timecop_resetObject



18
19
20
21
# File 'lib/rails-caddy/controllers/timecop_controller.rb', line 18

def timecop_reset
  session[:timecop_adjusted_time] = nil
  render :status => 200, :nothing => true
end

#timecop_updateObject



12
13
14
15
16
# File 'lib/rails-caddy/controllers/timecop_controller.rb', line 12

def timecop_update
  year, month, day, hour, min, sec = params[:year], params[:month], params[:day], params[:hour], params[:min], params[:sec]
  session[:timecop_adjusted_time] = Time.local(year, month, day, hour, min, sec)
  render :status => 200, :nothing => true
end