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