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