summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'projects/devdashboard/app/controllers/herds_controller.rb')
-rw-r--r--projects/devdashboard/app/controllers/herds_controller.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/projects/devdashboard/app/controllers/herds_controller.rb b/projects/devdashboard/app/controllers/herds_controller.rb
new file mode 100644
index 0000000..551b7bf
--- /dev/null
+++ b/projects/devdashboard/app/controllers/herds_controller.rb
@@ -0,0 +1,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