When sending a get request to http://localhost:3000/api/v1/events
to test that my API works, I get the following error.
Failure/Error: respond_with Event.all
NoMethodError:
undefined method `respond_with' for #<Api::V1::EventsController:0x007ff018f2edc8>
Did you mean? respond_to
My EventsController looks like this
class Api::V1::EventsController < ApplicationController
respond_to? :json
def index
respond_with Event.all
end
What am I doing wrong?