respond_to(*mimes, &block)
Instance Public methods
Without web-service support, an action which collects the data for
displaying a list of people might look something like this:
def index
@people = Person.all
end
Here's the same action, with web-service support baked in:
def index
@people = Person.all
respond_to do |format|
format.html
format.xml { render xml: @people }
end
end
What that says is, âif the client wants HTML in
response to this action, just resp