First argument in form cannot contain nil or be empty - Rails 4

前端 未结 7 1744
刺人心
刺人心 2020-12-04 19:24

I receive this error with my contact form in rails:

First argument in form cannot contain nil or be empty

View:

7条回答
  •  感情败类
    2020-12-04 20:15

    I had the same problem but it was easy to repair. In your #example posts_controler.rb add the same line to find post like in edit. In my application it's

    def edit
        @post = Post.find(params[:id])
    end
    

    It doesn't work here becase I added it but did not save my changes ;).

提交回复
热议问题