$(document).ready -> $(".ui-button").each -> $(this).button icons: primary: $(this).attr("data-icon") $("input[type='date'].ui-date-input, input[type='text'].ui-date-input" ).each -> options = {} if($(this).attr('data-calendar') != "") options = $.parseJSON($(this).attr('data-calendar')) $(this).datepicker(options) $(".ui-radio-input fieldset.to-buttonset").buttonset() $(".ui-check_boxes-input fieldset.to-buttonset").buttonset()