I think there are some causes of the error, but in my case it was that there was a space between params and [: id].
#Space is available
@post = Post.find(params [:id])
The error disappeared.
@post = Post.find(params[:id])
Recommended Posts