class ItemController < ApplicationController
def create
item = current_user.items.build(params[:presentstem])
item.created_at = Time.now
item.save!
redirect_to root_path
end
def destroy
end
end
我以观点/家庭/指数/html为形式增加一个项目。
<div id="add_item">
<p>Add a new item</p>
<% form_for Item.new do |f| %>
<div id="add_item_container">
<%= f.text_field :present %>
<%= f.text_field :stem %>
<%= f.text_field :secondary %>
<%= f.check_box :atype %>
<%= f.text_field :comment %>
</div>
<%= f.submit "Add to List" %>
<% end %>
</div>
How do I define Item
?
纽约总部 我
Expected /Users/user/Desktop/test/app/models/item.rb to define Item
Extracted source (around line #3):