![](/img/trans.png)
[英]Ruby on Rails 6: form submits an array of hashes via hidden field but gets blocked by <ActionController::Parameters ..... permitted: false>
[英]Ruby: Form not submit - ActionController::Parameters permitted: false
在我的項目中添加了一些寶石之后,我的表單不再創建條目。
我添加了devise
和active admin
,之后我的表單提交停止工作。 當我嘗試調試時,收到該消息:
# posts_controller.rb
def create
render plain: params[:post].inspect
end
輸出:
<ActionController::Parameters {"firstname"=>"Andreas", "lastname"=>"", "street"=>"", "city_code"=>"", "city"=>"", "state"=>"", "country"=>""} permitted: false>
這是生產代碼:
def create
@post = Post.new(post_params)
if(@post.save)
redirect_to @post
else
render 'new'
end
end
它提交表單,但不會生成數據庫條目。 有任何想法嗎?
謝謝你的幫助! 我不小心在我的控制器中有一個不存在的額外字段的要求。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.