I keep getting an error: wrong number of arguments (1 for 0)
def destroy
@event = Event.find(params(:id))
@event.destroy
flash[:success] = "Event destroyed."
redirect_to events_path
end
i'm trying to destroy an @event and it doesn't work because @event = Event.find(params(:id)) has the wrong number of parameters. what am i doing wrong?
It should be params[:id]
instead of params(:id)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With