Skip to content

ajvargo/jumping_jack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

== Welcome to Jumping Jack

This is a single controller and model web app that's (at least started) as joke.

It also served to give me a chance to mess with RoR 3 a bit, and try playing around
with jQuery objects for functional encapsulation a bit.

Its not tested at all. Sorry.

== Setup
1. Move over your database.yml
2. bundle install
3. rake db:migrate
4. Run it!

== Usage

Clicking Start starts the timer counting, and shows you a fancy jumping jack man.

Clicking Reset resets the timer, whether its running or not.

Clicking Save does nothing if the timer is at zero.  It saves via an ajax post
and updates the reports area otherwise. On save, it also resets the timer.

Rinse. Repeat.

== Internals

There is 1 controller with an index and create action. Woohoo.

There is 1 model with the attributes duration (in seconds) and the day (date created.
I know I could use created date, but this make the code feel better for me.)
There are also some scopes:
* sorted - returns sorted by day, descending
* today - returns trips from today
* month - returns all trips from the last month
* year  - returns...  3 guesses..

There is 1 helper with content. It has a function to turn seconds into an [h:]mm:ss string.
There is also a function to print the date as I'd like.

It uses the google provide jquery.  It includes jQuery.timers.js for the counting.

There is a single other js file, jumping_jack with handles the magic. Its pretty much
an object with all the reset, save, etc + helpers self contained.

Releases

No releases published

Packages

No packages published