0
我有这样的配置:Rails的联系抛出没有路由匹配错误
question.rb
class Question
belongs_to :asker
belongs_to :expert
end
user.rb
class User
has_one :asker
has_one :expert
end
我设置rails_admin,我不能由于错误而编辑任何问题。
ActionController::UrlGenerationError at /question/764/edit
No route matches {:action=>"show", :controller=>"rails_admin/main", :id=>nil, :model_name=>"asker"}
我试过在askers_controller.rb
加入表演方法,但它仍然没有任何区别。
谢谢。
嗨,我已经加入编辑方法也提问者的https://gist.github .COM/alagu/60e876fa33cbf830b816d878b9afa71c – Alagu
难道你想找到您要在 编辑喜欢高清编辑 @question = Question.find(764) 结束 该特定的记录? – VK29
对不起,我不明白你在说什么。我应该在askers_controller中做些什么#edit @question = Question.find(764)? – Alagu