# GET /arcs/1
# GET /arcs/1.xml
def show
- if /\A\d/.match(params[:id])
- @rec = Record::Arc.find(params[:id])
- @arc = Arc.find(@rec.code)
- redirect_to arc_path(@arc), :status => 301
- return
- end
@arc = Arc.find(params[:id])
respond_to do |format|
format.xml { render :xml => @arc }
end
end
-
- # GET /arcs/new
- # GET /arcs/new.xml
- def new
- @arc = Record::Arc.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @arc }
- end
- end
-
- # GET /arcs/1/edit
- def edit
- @arc = Record::Arc.find(params[:id])
- end
-
- # POST /arcs
- # POST /arcs.xml
- def create
- @arc = Record::Arc.new(params[:arc])
-
- respond_to do |format|
- if @arc.save
- flash[:notice] = 'Record::Arc was successfully created.'
- format.html { redirect_to(@arc) }
- format.xml { render :xml => @arc, :status => :created, :location => @arc }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @arc.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /arcs/1
- # PUT /arcs/1.xml
- def update
- @arc = Record::Arc.find(params[:id])
-
- respond_to do |format|
- if @arc.update_attributes(params[:arc])
- flash[:notice] = 'Record::Arc was successfully updated.'
- format.html { redirect_to(@arc) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @arc.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /arcs/1
- # DELETE /arcs/1.xml
- def destroy
- @arc = Record::Arc.find(params[:id])
- @arc.destroy
-
- respond_to do |format|
- format.html { redirect_to(arcs_url) }
- format.xml { head :ok }
- end
- end
end
+++ /dev/null
-class LocationsController < ApplicationController
- include AuthenticatedSystem
- layout 'arcs'
- before_filter :login_required, :only => [ :new, :edit, :create, :update, :destroy ]
-
- # GET /locations
- # GET /locations.xml
- def index
- @locations = Record::Location.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @locations }
- end
- end
-
- # GET /locations/1
- # GET /locations/1.xml
- def show
- @location = Record::Location.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @location }
- end
- end
-
- # GET /locations/new
- # GET /locations/new.xml
- def new
- @location = Record::Location.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @location }
- end
- end
-
- # GET /locations/1/edit
- def edit
- @location = Record::Location.find(params[:id])
- end
-
- # POST /locations
- # POST /locations.xml
- def create
- @location = Record::Location.new(params[:location])
-
- respond_to do |format|
- if @location.save
- flash[:notice] = 'Record::Location was successfully created.'
- format.html { redirect_to(@location) }
- format.xml { render :xml => @location, :status => :created, :location => @location }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /locations/1
- # PUT /locations/1.xml
- def update
- @location = Record::Location.find(params[:id])
-
- respond_to do |format|
- if @location.update_attributes(params[:location])
- flash[:notice] = 'Record::Location was successfully updated.'
- format.html { redirect_to(@location) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /locations/1
- # DELETE /locations/1.xml
- def destroy
- @location = Record::Location.find(params[:id])
- @location.destroy
-
- respond_to do |format|
- format.html { redirect_to(locations_url) }
- format.xml { head :ok }
- end
- end
-end
format.xml { render :xml => @pmds }
end
end
-
- # GET /pmds/1
- # GET /pmds/1.xml
- def show
- @pmd = Record::Pmd.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @pmd }
- end
- end
-
- # GET /pmds/new
- # GET /pmds/new.xml
- def new
- @pmd = Record::Pmd.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @pmd }
- end
- end
-
- # GET /pmds/1/edit
- def edit
- @pmd = Record::Pmd.find(params[:id])
- end
-
- # POST /pmds
- # POST /pmds.xml
- def create
- @pmd = Record::Pmd.new(params[:pmd])
-
- respond_to do |format|
- if @pmd.save
- flash[:notice] = 'Record::Pmd was successfully created.'
- format.html { redirect_to(@pmd) }
- format.xml { render :xml => @pmd, :status => :created, :location => @pmd }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /pmds/1
- # PUT /pmds/1.xml
- def update
- @pmd = Record::Pmd.find(params[:id])
-
- respond_to do |format|
- if @pmd.update_attributes(params[:pmd])
- flash[:notice] = 'Record::Pmd was successfully updated.'
- format.html { redirect_to(@pmd) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @pmd.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /pmds/1
- # DELETE /pmds/1.xml
- def destroy
- @pmd = Record::Pmd.find(params[:id])
- @pmd.destroy
-
- respond_to do |format|
- format.html { redirect_to(pmds_url) }
- format.xml { head :ok }
- end
- end
end
format.xml { render :xml => @thumb }
end
end
-
- # GET /thumbs/new
- # GET /thumbs/new.xml
- def new
- @thumb = Record::Thumb.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @thumb }
- end
- end
-
- # GET /thumbs/1/edit
- def edit
- @thumb = Record::Thumb.find(params[:id])
- end
-
- # POST /thumbs
- # POST /thumbs.xml
- def create
- @thumb = Record::Thumb.new(params[:thumb])
- @thumb.video_id = params[:thumb].delete(:video_id)
-
- respond_to do |format|
- if @thumb.save
- flash[:notice] = 'Record::Thumb was successfully created.'
- format.html { redirect_to(@thumb) }
- format.xml { render :xml => @thumb, :status => :created, :location => @thumb }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @thumb.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /thumbs/1
- # PUT /thumbs/1.xml
- def update
- @thumb = Record::Thumb.find(params[:id])
-
- respond_to do |format|
- if @thumb.update_attributes(params[:thumb])
- flash[:notice] = 'Record::Thumb was successfully updated.'
- format.html { redirect_to(@thumb) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @thumb.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /thumbs/1
- # DELETE /thumbs/1.xml
- def destroy
- @thumb = Record::Thumb.find(params[:id])
- @thumb.destroy
-
- respond_to do |format|
- format.html { redirect_to(thumbs_url) }
- format.xml { head :ok }
- end
- end
end
format.xml { render :xml => @vmds }
end
end
-
- # GET /vmds/1
- # GET /vmds/1.xml
- def show
- @vmd = Record::Vmd.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @vmd }
- end
- end
-
- # GET /vmds/new
- # GET /vmds/new.xml
- def new
- @vmd = Record::Vmd.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @vmd }
- end
- end
-
- # GET /vmds/1/edit
- def edit
- @vmd = Record::Vmd.find(params[:id])
- end
-
- # POST /vmds
- # POST /vmds.xml
- def create
- @vmd = Record::Vmd.new(params[:vmd])
-
- respond_to do |format|
- if @vmd.save
- flash[:notice] = 'Record::Vmd was successfully created.'
- format.html { redirect_to(@vmd) }
- format.xml { render :xml => @vmd, :status => :created, :location => @vmd }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @vmd.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /vmds/1
- # PUT /vmds/1.xml
- def update
- @vmd = Record::Vmd.find(params[:id])
-
- respond_to do |format|
- if @vmd.update_attributes(params[:vmd])
- flash[:notice] = 'Record::Vmd was successfully updated.'
- format.html { redirect_to(@vmd) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @vmd.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /vmds/1
- # DELETE /vmds/1.xml
- def destroy
- @vmd = Record::Vmd.find(params[:id])
- @vmd.destroy
-
- respond_to do |format|
- format.html { redirect_to(vmds_url) }
- format.xml { head :ok }
- end
- end
end
format.xml { render :xml => @xes }
end
end
-
- # GET /xes/1
- # GET /xes/1.xml
- def show
- @x = Record::X.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @x }
- end
- end
-
- # GET /xes/new
- # GET /xes/new.xml
- def new
- @x = Record::X.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @x }
- end
- end
-
- # GET /xes/1/edit
- def edit
- @x = Record::X.find(params[:id])
- end
-
- # POST /xes
- # POST /xes.xml
- def create
- @x = Record::X.new(params[:x])
-
- respond_to do |format|
- if @x.save
- flash[:notice] = 'Record::X was successfully created.'
- format.html { redirect_to(@x) }
- format.xml { render :xml => @x, :status => :created, :location => @x }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @x.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /xes/1
- # PUT /xes/1.xml
- def update
- @x = Record::X.find(params[:id])
-
- respond_to do |format|
- if @x.update_attributes(params[:x])
- flash[:notice] = 'Record::X was successfully updated.'
- format.html { redirect_to(@x) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @x.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /xes/1
- # DELETE /xes/1.xml
- def destroy
- @x = Record::X.find(params[:id])
- @x.destroy
-
- respond_to do |format|
- format.html { redirect_to(xes_url) }
- format.xml { head :ok }
- end
- end
end
Nimono::Application.routes.draw do
- resources :sites
+ resources :sites, :only => [ :index, :show ]
- resources :arcs
- resources :pmds
- resources :vmds
- resources :xes
- resources :locations
- resources :thumbs
+ resources :arcs, :only => [ :index, :show ]
+ resources :pmds, :only => :index
+ resources :vmds, :only => :index
+ resources :xes, :only => :index
+ resources :thumbs, :only => [ :index, :show ]
resource :session
root :to => 'welcome#index'
get 'welcome/about'