Кнопка next comment
должна быть направлена в http://localhost:3000/articles/14/comments/70
.Ruby on Rails: контроллер не метод оценки
Что в настоящее время выполняет это: http://localhost:3000/articles/14/comments/56/next_comment
Как один исправить это?
#button
= link_to "next comment", next_comment_article_comment_path(@article, @comment)
#controller
class CommentsController < ApplicationController
def next_comment
@comment ||= @scope.next(@comment)
end
def scope
@scope ||= @article.comments
end
end
UPDATE
#routes.rb
resources :articles do
resources :comments do
member do
get 'next_comment'
end
end
end
Вы можете обновить свой вопрос с 'routes.rb' кодом ? – Pavan
Сделано! Спасибо ... – Liroy
любая подсказка, что здесь происходит? – Liroy