Rails edit.html.erb ArgumentError

前端 未结 1 923
天命终不由人
天命终不由人 2021-01-24 07:58

New to rails and I went through the Hartl Tutorial and trying to make some changes. I would like to allow users to edit posts (which I am calling routes) and am getting this er

相关标签:
1条回答
  • 2021-01-24 08:03

    You have to set the @route variable in your edit action in the controller.

    def edit
          @route = Route.find(params[:id])
    end
    

    That should do it.

    0 讨论(0)
提交回复
热议问题