Rails 部分错误 - 未找到路线
当我在没有 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:in
each' 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__1164388053_2171521760_0'
When I render this partial without AJAX it works fine but when I render it using AJAX call i get the following exception.
What am I doing wrong ?
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'
each'
app/views/discussions/_edit_topics.html.erb:2:in
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__1164388053_2171521760_0'
app/views/follows/create.js.erb:9:in
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论