Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.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 尝试提交表单时出现奇怪的Rails行为_Ruby On Rails_Forms - Fatal编程技术网

Ruby on rails 尝试提交表单时出现奇怪的Rails行为

Ruby on rails 尝试提交表单时出现奇怪的Rails行为,ruby-on-rails,forms,Ruby On Rails,Forms,我有一个notes模型,它与用户模型有多对多关系。在notes控制器的索引视图中,我有以下表格: <form id='note_form' method="post" action="/notes/temp_path" > <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" /> <input type=

我有一个
notes
模型,它与
用户
模型有多对多关系。在
notes
控制器的索引视图中,我有以下表格:

<form id='note_form' method="post" action="/notes/temp_path" >
    <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />        
    <input type="text" size="30" name="start_date" id="start_date">
</form>

我很确定
WHERE(“user\u notes.”“note\u id”=0)
位是导致问题的原因。但我不知道为什么会这样做?根据上面的行,
User Load(0.3ms)选择“users”*。
这似乎是Rails的幕后工作。在临时路径操作中,我不需要加载现有便笺。我怎样才能阻止这一切?我使用的是Rails 3.0.1。感谢阅读。

您应该向我们展示控制器的代码。你有什么“重定向到”的说法吗?有什么条件吗

也许您的控制器中有一些过滤器,或者ApplicationController中有一些过滤器?从弃用警告中,我看到您可能有一些代码

Started POST "/notes/temp_path" for 127.0.0.1 at 2010-12-08 22:08:25 +1000
DEPRECATION WARNING: Setting filter_parameter_logging in ActionController is deprecated and has no longer effect, please set 'config.filter_parameters' in config/application.rb instead. (called from <class:ApplicationController> at /Users/ben/rails_projects/note_prog/app/controllers/application_controller.rb:6)
  Processing by NotesController#temp_path as HTML
  Parameters: {"authenticity_token"=>"Ck6NmmYO86rvJSEsiqpIMkcaiErEhV7s/XMzjka15AI="}
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE ("users"."id" = 56) LIMIT 1
  UserNote Load (0.2ms)  SELECT "user_notes".* FROM "user_notes" WHERE ("user_notes"."note_id" = 0)
Redirected to http://localhost:3000/notes