我是一个Ruby on Rails新手,按照网上的入门教程去练习,然后进行到5.7章节(网址在这里)的时候出现NoMethodError错误,我后来上网搜索解决方案,依然没有成功解决,我是按照这个教程一步一步练习的。
下面是我代码和错误信息的截图
后来我问身边的朋友,他们说是版本问题,我Ruby版本是2.2.3,Rails是5.0.0,不过如何解决这个错误,希望有专业高手帮我解答,多谢!
小伙看你根骨奇佳,潜力无限,来学PHP伐。
Your show action is defined under private, and the view layer cannot get your variables
The index action under your DropsControler is defined after the private keyword, so it is a private method, so you cannot get the show action when rendering the view, so noMethodError is displayed
Your show action is defined under private, and the view layer cannot get your variables
The index action under your DropsControler is defined after the private keyword, so it is a private method, so you cannot get the show action when rendering the view, so noMethodError is displayed