Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View stereoscott's full-sized avatar

Scott Meves stereoscott

View GitHub Profile
@xdite
xdite / 42-things.md
Created July 14, 2012 05:11
Ten (42) Things You Didn't Know Rails Could Do
@aganov
aganov / datetime_ui_input.rb
Created October 4, 2011 13:48
Formtastic jQuery UI date and time picker input
# http://jqueryui.com/demos/datepicker/
# http://fgelinas.com/code/timepicker/
class DatetimeUiInput
include Formtastic::Inputs::Base
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M"
def to_html
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);