0
Bootstrap3 Datetimepicker
をRails4アプリに適用したいと思います。Rails 4 x Bootstrap 3 Datetimepicker:デザインが良くない
しかし、レイアウトはこのページのように(質問画像の途中で)良くありません。 Rails 4 x Bootstrap 3 Datetimepicker: replace default datetime_select with datetimepicker
あなたが私に何か示唆を与えることができれば幸いです。
_xxx_form.html.erb
<%= simple_nested_form_for(@schedule) do |f| %>
<div class="input-group date" id="datetimepicker">
<%= f.label :departure_date %>
<%= f.text_field :departure_date, class: 'form-control' %>
<span class="input-group-addon">
<span class="glyphicon-calendar glyphicon"></span>
</span>
</div>
<script type="text/javascript">
$(function() {
$('#datetimepicker').datetimepicker({format:'MMM-DD-YYYY'});
});
</script>
...
を解決しよう!
レイアウトは、f.label
を<div class="input-group date" id="datetimepicker">
の外に移動した後に予想通りでした。
...
<%= f.label :departure_date %>
<div class="input-group date" id="datetimepicker">
<%= f.text_field :departure_date, class: 'form-control' %>
...
カレンダーを表示し、入力フィールドをクリックし、私の質問の下部にある自分の質問を解決しました。 – SamuraiBlue