很抱歉这里的基本问题,但是我试图在带有模式的Rails应用程序上使用Fullcal系统来创建事件。我的表单中包含以下内容:
<div class='input-group date' id='datetimepickerA'>
<%= f.text_field :start, :class => "form-control" %>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
和Javascript:
$(function () {
$('#datetimepickerA').datetimepicker({
defaultDate: "<%= DateTime.now %>",
format: '%Y-%m-%dT%H:%M:%S'
});
});
</SCRIPT>
在其他人中。
当我尝试验证输入时,我有以下内容:
Processing by EventsController#create as JS
Parameters: {"utf8"=>"✓", "event"=>{"title"=>"Meeting with Tangui", "start"=>"2018-11-18 06:13 pm +08:00"}, "commit"=>"Create Event", "locale"=>"en-us"}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
Unpermitted parameters: :utf8, :event, :commit, :locale
(0.1ms) begin transaction
(0.1ms) rollback transaction
Rendering events/create.js.erb
Rendered events/_event.json.jbuilder (41.6ms)
Rendered events/create.js.erb (92.2ms)
Completed 500 Internal Server Error in 278ms (ActiveRecord: 1.7ms)
ActionView::Template::Error (undefined method `midnight' for nil:NilClass):
1: date_format = event.all_day_event? ? '%Y-%m-%d' : '%Y-%m-%dT%H:%M:%S'
2:
3: json.id event.id
4: json.title event.title
app/models/event.rb:10:in `all_day_event?'
有人熟悉该插件吗?由于该日期问题,我的输入内容均无效。