Skip to content

Instantly share code, notes, and snippets.

View zjyuwish's full-sized avatar

Jinyu Zhang zjyuwish

  • The Ohio State University
  • United States
View GitHub Profile
@zjyuwish
zjyuwish / jquery-ui-datepicker-rails-part1.html.haml
Last active August 29, 2015 14:27 — forked from mvilrokx/jquery-ui-datepicker-rails-part1.html.haml
Adding jquery-ui datepicker to rails view
# in your application layout (using HAML)
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'
= stylesheet_link_tag "//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css"
# in your view (HAML + simple_form, simplified for easier reading)
= simple_form_for @bp_reading do |f|
= f.input :recorded_at, :as => :string, :input_html => { :class => 'jquery-ui-date'}
= f.button :submit, :disable_with => "Saving...", :value => "Save"
# in your javascript (coffeescript)