Sha256: 830bae52bf06fc1c7063bb617d898a01369793337448902b584054699310feee
Contents?: true
Size: 975 Bytes
Versions: 7
Compression:
Stored size: 975 Bytes
Contents
module Plutus # 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 class EntriesController < Plutus::ApplicationController unloadable # @example # GET /entries # GET /entries.xml # GET /entries.json def index if params[:order] == 'ascending' order = 'ASC' else order = 'DESC' end @entries = Entry.page(params[:page]).per(params[:limit]).order("date #{order}") respond_to do |format| format.html # index.html.erb format.xml { render :xml => @entries } format.json { render :json => @entries } end end end end
Version data entries
7 entries across 7 versions & 3 rubygems