在我的 Rails 应用程序(v. 4.1.9)中,创建操作后出现以下错误:
arguments passed to url_for can't be handled. Please require routes or provide your own implementation
这是我的代码:
路线.rb
scope module: :explore do
resources :questions
end
questions_controller.rb
class Explore::QuestionsController < Explore::BaseController
respond_to :html
authorize_resource
def create
@question = Question.new question_params
@question.save
respond_with @question
end
end
我也尝试过respond_with question_path
,redirect_to question_path
但总是同样的错误。
有任何想法吗?