Sha256: 6abf1b94b77d2653c57f89539497e2d5743d8684a9ec76d8dfe003a7fce2bfe2

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

# This controller provides restful route handling for Accounts.
#
# The controller supports ActiveResource, and provides for
# HMTL, XML, and JSON presentation.
#
# == Security:
# Only GET requests are supported. You should ensure that your application
# controller enforces its own authentication and authorization, which this 
# controller will inherit.
# 
# @author Michael Bulat
class AccountsController < ApplicationController
  unloadable
  
  # @example
  #   GET /accounts
  #   GET /accounts.xml
  #   GET /accounts.json
  def index
    @accounts = Account.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @accounts }
      format.json  { render :json => @accounts }
    end
  end
  
  # @example
  #   GET /accounts/1
  #   GET /accounts/1.xml
  #   GET /accounts/1.json
  def show
    @account = Account.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @account }
      format.json  { render :json => @account }
    end
  end  
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
blawzoo-plutus-0.5.3 app/controllers/accounts_controller.rb
plutus-0.5.2 app/controllers/accounts_controller.rb
plutus-0.5.1 app/controllers/accounts_controller.rb
plutus-0.4.2 app/controllers/accounts_controller.rb