[RUBY] wrong number of arguments (given 1, expected 0)

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

wrong number of arguments (given 1, expected 0)
ArgumentError (wrong number of arguments (given 0, expected 1)) error message
[Rails] How to resolve wrong number of arguments (given 2, expected 0..1) of user_id
[Rails] Sign-up function using devise error number of arguments (given 0, expected 1)
What to do if you get an Argument Error: wrong number of arguments (given 2, expected 0) in your RSpec test
What to do if you get a wrong number of arguments error in binding.pry
Arguments of String.addingPercentEncoding (withAllowedCharacters :)
[Ruby] Questions and verification about the number of method arguments