1 class PmdsController < ApplicationController
2 include AuthenticatedSystem
8 @search = Pmd::Search.new(params[:search])
9 @pmds = Pmd.paginate(@search.find_options.merge(:page => params[:page], :include => :arc))
11 respond_to do |format|
12 format.html # index.html.erb
13 format.xml { render :xml => @pmds }
20 @pmd = Pmd.find(params[:id])
22 respond_to do |format|
23 format.html # show.html.erb
24 format.xml { render :xml => @pmd }
33 respond_to do |format|
34 format.html # new.html.erb
35 format.xml { render :xml => @pmd }
41 @pmd = Pmd.find(params[:id])
47 @pmd = Pmd.new(params[:pmd])
49 respond_to do |format|
51 flash[:notice] = 'Pmd was successfully created.'
52 format.html { redirect_to(@pmd) }
53 format.xml { render :xml => @pmd, :status => :created, :location => @pmd }
55 format.html { render :action => "new" }
56 format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
64 @pmd = Pmd.find(params[:id])
66 respond_to do |format|
67 if @pmd.update_attributes(params[:pmd])
68 flash[:notice] = 'Pmd was successfully updated.'
69 format.html { redirect_to(@pmd) }
70 format.xml { head :ok }
72 format.html { render :action => "edit" }
73 format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
81 @pmd = Pmd.find(params[:id])
84 respond_to do |format|
85 format.html { redirect_to(pmds_url) }
86 format.xml { head :ok }