访问哈希数组中的数据

时间:2016-05-04 15:31:53

标签: ruby-on-rails arrays hash

在日志中我看到变量@step_attributes的值是:

 $('#datetimepicker').datepicker({
       dateFormat: 'yy-mm-dd',
       showButtonPanel: true,

        onClose: function () {
            var selectedDate= new Date($('#datetimepicker').val())
alert(selectDate.getDate())
       }
 });

我在访问此数据时遇到问题,无法打印它们。我猜测打印哈希数组的方法应该有效,但不适合我。某人可以帮我这个吗?

1 个答案:

答案 0 :(得分:0)

这些是对象。你应该可以用

来找他们

@step_attributes[0].value