我试图利用废墟论坛的助手确定一个时间点。
<%= form_for @event do |f| %>
<%= render shared/error_messages , :object => f.object %>
<strong>Title</strong>
<div class="field">
<%= f.text_field :title %>
</div>
<strong>Description</strong>
<div class="field">
<%= f.text_area :description, :class => "comment" %>
</div>
<strong>Location</strong>
<div class="field">
<%= f.text_field :location %>
</div>
<strong>Time</strong>
<div class="field">
<%= select_datetime Date.today, :prefix => :start_date %>
</div>
<div class="actions">
<%= f.submit "Add Event" %>
</div>
<% end %>
In the controller I am doing this: class EventsController < ApplicationController def index @event = Event.new end
def create
@event = current_user.events.build(params[:event])
if @event.save
redirect_to root_path, :flash => { :success => "#{@event.inspect}!" }
else
@feed_items = []
render pages/home
end
end
end
然而,时间从未确定......我究竟是错了吗?