summaryrefslogtreecommitdiff
blob: 551b7bf1885f3fe8fa78ca903154ee9f86ddea0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class HerdsController < ApplicationController
  def index
    list
    render :action => 'list'
  end

  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
  verify :method => :post, :only => [ :destroy, :create, :update ],
         :redirect_to => { :action => :list }

  def list
    @herd_pages, @herds = paginate :herds, :per_page => 10
  end

  def show
    @herd = Herd.find(params[:id])
  end

  def load_from_xml
    Herd.load_from_xml
    redirect_to :action => 'list'
  end
end