Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.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 当我尝试添加表单时,行消失_Ruby On Rails_Ruby On Rails 3_Forms - Fatal编程技术网

Ruby on rails 当我尝试添加表单时,行消失

Ruby on rails 当我尝试添加表单时,行消失,ruby-on-rails,ruby-on-rails-3,forms,Ruby On Rails,Ruby On Rails 3,Forms,所以,我试着跟着你。我正在尝试将其转换为我自己的项目,其中我有一组行,这些行是基于在第一个表单中应用搜索条件的结果显示的。我现在尝试在结果周围放置第二个表单,为管理员提供复选框,以便能够同时编辑显示的多行。然而,当我尝试在结果周围放置一个表格时,结果完全消失了 以下是我的控制器的相关部分: def index @search = Distribution.workflow.search(params[:traits_searchable_search]) respond_t

所以,我试着跟着你。我正在尝试将其转换为我自己的项目,其中我有一组行,这些行是基于在第一个表单中应用搜索条件的结果显示的。我现在尝试在结果周围放置第二个表单,为管理员提供复选框,以便能够同时编辑显示的多行。然而,当我尝试在结果周围放置一个表格时,结果完全消失了

以下是我的控制器的相关部分:

  def index
    @search = Distribution.workflow.search(params[:traits_searchable_search])

    respond_to do |f|
      f.html  {
        @report = @search.paginate(:page => params[:page])
        render :action => 'index'
      }
      f.csv do
        send_data @report.to_csv, :type => "text/csv", :filename => "distribution_workflow_report.csv"
      end
    end
  end
景色没什么特别的。但是我正在尝试包装这个标签(我还尝试删除了
:method=>:put
部分,值得注意的是,提供给form_标签的路径就是目前正在显示的页面,直到我弄清楚如何让路由工作为止):

:put do%>
围绕这张桌子:

  <table class="standard-grid">
<tr>
  <th class="first"></th>
  <th>ID</th>
  <th>Customer</th>
  <th>Customer Email</th>
  <th>Resume URL</th>
  <th>Partner</th>
  <th>Partner Email</th>
  <th>Status</th>
  <th>Assigned To</th>
  <th>Comments</th>
  <th></th>
</tr>
<% @report.each do |row| %>
  <tr>
  <td><%= check_box_tag "row_ids[]", row.id %></td>
  <td>
    <%= row.owner.id %>
  </td>
  ....
</td>
</tr>
<% end %>
  </table>
<% end %>

身份证件
顾客
客户电子邮件
恢复URL
搭档
合作伙伴电子邮件
地位
分配给
评论
....

由于Rails 3,您必须使用

  <table class="standard-grid">
<tr>
  <th class="first"></th>
  <th>ID</th>
  <th>Customer</th>
  <th>Customer Email</th>
  <th>Resume URL</th>
  <th>Partner</th>
  <th>Partner Email</th>
  <th>Status</th>
  <th>Assigned To</th>
  <th>Comments</th>
  <th></th>
</tr>
<% @report.each do |row| %>
  <tr>
  <td><%= check_box_tag "row_ids[]", row.id %></td>
  <td>
    <%= row.owner.id %>
  </td>
  ....
</td>
</tr>
<% end %>
  </table>
<% end %>
<%= form_tag