【发布时间】:2015-10-09 19:41:17
【问题描述】:
据我所知,rails 表单的 new 操作通常会实例化模型并提供带有允许参数输入的视图。
def new
@post = Post.new
end
我不明白用户提交的相同信息是如何传递到create 操作中的Post.new 方法的:
def create
@post = Post.new(post_params)
...
end
尽管发生了页面刷新,rails 如何将这些参数引导到create?
【问题讨论】:
标签: ruby-on-rails rest model-view-controller controller