我有CRUD,当创建一个新的条目时,没有任何东西被保存,并且没有错误产生。我可以看到日志中发生的帖子。Ruby on Rails不保存岗位数据
控制器
def new
@article = Article.new
end
def create
@article = Article.new(params[:article])
if @article.save
redirect_to @article
else
render :action => 'new'
end
end
模型
class Article < ActiveRecord::Base
attr_accessible :title, :content end
路线
map.resources :articles
登录
Parameters: {"article"=>{"title"=>"Dive trip", "content"=>"hfigoo"}, "commit"=>"Save changes"}
任何帮助表示赞赏:-)
您是否在'rails console'中试过了? – David
不知道,不知道该怎么办? – gilbert
请显示表格 –