ActionController::MimeResponds

module ActionController::MimeResponds

Public Instance Methods

respond_to(*mimes) { |collector| ... } Show source

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 xm