Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 Rails form_for locale无符号到整数的隐式转换_Ruby On Rails 4_Form For - Fatal编程技术网

Ruby on rails 4 Rails form_for locale无符号到整数的隐式转换

Ruby on rails 4 Rails form_for locale无符号到整数的隐式转换,ruby-on-rails-4,form-for,Ruby On Rails 4,Form For,我陷入困境,试图为我的评论模型创建表单。我尝试通过区域设置获取post_id和user_id,将它们传递到表单,并为注释文本创建text_字段。在那之后,我得到了“没有将符号隐式转换为整数”的错误。 我的代码: 错误发生在途中。正确版本: <%= form_for @comment, url:user_post_comments(user_id: user_id, post_id: post_id) do |f| %> <%= form_for @comment, url

我陷入困境,试图为我的评论模型创建表单。我尝试通过区域设置获取post_id和user_id,将它们传递到表单,并为注释文本创建text_字段。在那之后,我得到了“没有将符号隐式转换为整数”的错误。 我的代码:


错误发生在途中。正确版本:

<%= form_for @comment, url:user_post_comments(user_id: user_id, post_id: post_id) do |f| %>

<%= form_for @comment, url:user_post_comments(user_id: user_id, post_id: post_id) do |f| %>