Class: Plutus::EntriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/plutus/entries_controller.rb

Overview

This controller provides restful route handling for Entries.

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

Instance Method Summary collapse

Instance Method Details

#indexObject

Examples:

GET /entries
GET /entries.xml
GET /entries.json

19
20
21
22
23
24
25
26
27
# File 'app/controllers/plutus/entries_controller.rb', line 19

def index
  @entries = Entry.limit(100).order('date DESC')

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