1 class PmdsController < ApplicationController
2 include AuthenticatedSystem
4 before_filter :login_required, :only => [ :new, :edit, :create, :update, :destroy ]
9 @search = Pmd::Search.new(params[:search])
10 @pmds = Pmd.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 => @pmds }
21 @pmd = Pmd.find(params[:id])
23 respond_to do |format|
24 format.html # show.html.erb
25 format.xml { render :xml => @pmd }
34 respond_to do |format|
35 format.html # new.html.erb
36 format.xml { render :xml => @pmd }
42 @pmd = Pmd.find(params[:id])
48 @pmd = Pmd.new(params[:pmd])
50 respond_to do |format|
52 flash[:notice] = 'Pmd was successfully created.'
53 format.html { redirect_to(@pmd) }
54 format.xml { render :xml => @pmd, :status => :created, :location => @pmd }
56 format.html { render :action => "new" }
57 format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
65 @pmd = Pmd.find(params[:id])
67 respond_to do |format|
68 if @pmd.update_attributes(params[:pmd])
69 flash[:notice] = 'Pmd was successfully updated.'
70 format.html { redirect_to(@pmd) }
71 format.xml { head :ok }
73 format.html { render :action => "edit" }
74 format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
82 @pmd = Pmd.find(params[:id])
85 respond_to do |format|
86 format.html { redirect_to(pmds_url) }
87 format.xml { head :ok }