2015-09-01 32 views
0

我正在处理任务问题报告项目。我有一个日历,当我点击选择日期时,我无法将日期值传递给Redmine中的控制器。我正在使用Bootstrap datepicker。如何将日期值从日历传递到控制器中的导轨

<div id="datepicker"> 
    <input type="text" data-provide='datepicker' : hidden="true"> 
    <input type="text" class='datepicker' name="reportdate" onchange = "this.form.submit();" 
</div> 
$(document).ready(function() { 
    $('.datepicker').datepicker(); 
}); 
+0

是否有表单要提交? – Swards

回答

0

这里我添加了一个非常基本的形式使用引导与日期选取提交,你必须在这里得到一个想法形式。

<%= form_for(@object) do |f| %> 
    <div class="form-group"> 
     <%= f.label :start_at %> 
     <div class="datepicker" class="input-group date"> 
     <%= f.text_field :start_at, :class => "form-control" %> 
     <span class="input-group-addon add-on"><i class="glyphicon glyphicon-calendar"></i></span> 
     </div> 
    </div> 

    <div class="form-actions"> 
     <%= f.submit %> 
    </div> 
<% end %> 

<script> 
    $(document).ready(function() { 
    $('.datepicker').datepicker(); 
    }); 
</script> 
相关问题