1 class XesController < ApplicationController
2 include AuthenticatedSystem
4 before_filter :login_required, :only => [ :new, :edit, :create, :update, :destroy ]
9 @search = Record::X::Search.new(params[:search])
10 @xes = Record::X.paginate(@search.find_options.merge(:page => params[:page], :include => :arc))
12 respond_to do |format|
13 format.html # index.html.erb
14 format.xml { render :xml => @xes }
21 @x = Record::X.find(params[:id])
23 respond_to do |format|
24 format.html # show.html.erb
25 format.xml { render :xml => @x }
34 respond_to do |format|
35 format.html # new.html.erb
36 format.xml { render :xml => @x }
42 @x = Record::X.find(params[:id])
48 @x = Record::X.new(params[:x])
50 respond_to do |format|
52 flash[:notice] = 'Record::X was successfully created.'
53 format.html { redirect_to(@x) }
54 format.xml { render :xml => @x, :status => :created, :location => @x }
56 format.html { render :action => "new" }
57 format.xml { render :xml => @x.errors, :status => :unprocessable_entity }
65 @x = Record::X.find(params[:id])
67 respond_to do |format|
68 if @x.update_attributes(params[:x])
69 flash[:notice] = 'Record::X was successfully updated.'
70 format.html { redirect_to(@x) }
71 format.xml { head :ok }
73 format.html { render :action => "edit" }
74 format.xml { render :xml => @x.errors, :status => :unprocessable_entity }
82 @x = Record::X.find(params[:id])
85 respond_to do |format|
86 format.html { redirect_to(xes_url) }
87 format.xml { head :ok }