TimeMachine

This rails plugin lets you easily change the current date. Useful to see how the app looks and behaves when time changes.

Installation

Add gem ‘time_machine’ to your development group and add this in a view file (ie application layout):

<%= time_machine if Rails.env.development? %>

Reload, and you’ll see a small box in the upper left corner of your app. Use this to travel in time and see how your app behaves/looks like when time changes.

Options

You can pass some options to the time_machine helper to change some settings:

<%= time_machine style: 'dark', position: 'top-right', state: 'collapsed' %>

Behind the scenes

It’s just an engine with two routes. When you select a date you’re sent to /time_machine/the-date where Timecop changes the date, and then you’re redirected back to where you came from.