Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.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 - Fatal编程技术网

Ruby on rails 链接到“不工作”和“未找到获取页面”仅允许获取和发布请求

Ruby on rails 链接到“不工作”和“未找到获取页面”仅允许获取和发布请求,ruby-on-rails,ruby,Ruby On Rails,Ruby,我必须删除路线。但我得到“只允许get和post请求”。请帮助任何人我为什么会出错。尝试将其更改为此 account_shows GET /expos/:account_id/events(.:format) {:action=>"index", :controller=>"shows"} POST /expos/:account_id/events(.:format) {:action=>

我必须删除路线。但我得到“只允许get和post请求”。请帮助任何人我为什么会出错。

尝试将其更改为此

    account_shows GET    /expos/:account_id/events(.:format)          {:action=>"index", :controller=>"shows"}
                  POST   /expos/:account_id/events(.:format)          {:action=>"create", :controller=>"shows"}
 new_account_show GET    /expos/:account_id/events/new(.:format)      {:action=>"new", :controller=>"shows"}
edit_account_show GET    /expos/:account_id/events/:id/edit(.:format) {:action=>"edit", :controller=>"shows"}
     account_show GET    /expos/:account_id/events/:id(.:format)      {:action=>"show", :controller=>"shows"}
                  PUT    /expos/:account_id/events/:id(.:format)      {:action=>"update", :controller=>"shows"}
                  DELETE /expos/:account_id/events/:id(.:format)      {:action=>"destroy", :controller=>"shows"}

“你确定吗?”,:method=>:delete%>
确保标题中包含以下内容:

<% @events.each do |e| %>
      <%= link_to '<i class=icon-trash></i>'.html_safe, account_show_path(@context, @event), :confirm => 'Are you sure?', :method => :delete %>
<% end %>
true%>

你能发布你的application.js文件代码吗?应该在这里:
app/assets/javascripts/application.js
为您做了一个编辑,对我来说很好!我也尝试过帐户显示路径(@context)不起作用。因为account_show_path(@context,e)需要两个参数。但我仍然只能收到get和post请求。谁能解决这个问题。
<% @events.each do |e| %>
      <%= link_to '<i class=icon-trash></i>'.html_safe, account_show_path(@context, @event), :confirm => 'Are you sure?', :method => :delete %>
<% end %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
      <%= csrf_meta_tags %>