Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.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_Routing_Partial Views - Fatal编程技术网

Ruby on rails rails部分错误-未找到路由

Ruby on rails rails部分错误-未找到路由,ruby-on-rails,routing,partial-views,Ruby On Rails,Routing,Partial Views,当我在没有AJAX的情况下渲染这个部分时,它工作得很好,但是当我使用AJAX调用渲染它时,我得到了以下异常 我做错了什么 ActionView::Template::Error (No route matches {:action=>"destroy", :followerid=>1, :follower_type=>"topic", :controller=>"follows", :discussion_id=>91}): 2: <% discuss

当我在没有AJAX的情况下渲染这个部分时,它工作得很好,但是当我使用AJAX调用渲染它时,我得到了以下异常

我做错了什么

ActionView::Template::Error (No route matches {:action=>"destroy", :followerid=>1,     :follower_type=>"topic", :controller=>"follows", :discussion_id=>91}):
2: <% discussion.followers.each do |topic| %>
3:     <% if topic.is_a? Topic%>
4:           <h3><%= render :partial => '/shared/topic_item', :locals => { :topic => topic }%></h3>
5:           <%= button_to("unTag", discussion_follow_path(discussion.id, :follower_type => "topic", :followerid => topic.id ), :method => :delete, :remote =>true) %>
6:     <%end%>
7: <%end%>
app/views/discussions/_edit_topics.html.erb:5:in_app_views_discussions_edit_topics_html_erb_847854145_2171200660_7386124' app/views/discussions/_edit_topics.html.erb:2:ineach' app/views/discussions/_edit_topics.html.erb:2:in_app_views_discussions_edit_topics_html_erb_847854145_2171200660_7386124'
app/views/follows/create.js.erb:9:in_app_views_follows_create_js_erb__11643888053_2171521760_0'

您是否在路由文件中添加了类似资源:主题的内容?是的。资源:主题做资源:如下,:only=>[:创建,:销毁]结束