summaryrefslogtreecommitdiff
path: root/help/app/helpers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-27 10:01:07 +0100
committerAzul <azul@leap.se>2012-11-27 10:01:07 +0100
commitbe479d2c55d502c6e4303700b68e0a619f646834 (patch)
tree1ff9e4f0db9ab9bee2d2e0f3ace5f099bff28034 /help/app/helpers
parenta8b8a7b5431f57ebcf295b8d9389d44cc3a49e8e (diff)
bunch of refactoring for the ticket index
* using different partials for different parts of the view * using render @tickets.all to iterate over the tickets. #all is necessary because of CouchRest Model * using helpers for easier querying for the open_status and admin_status params * using helper for avoiding duplication when linking to status
Diffstat (limited to 'help/app/helpers')
-rw-r--r--help/app/helpers/tickets_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/help/app/helpers/tickets_helper.rb b/help/app/helpers/tickets_helper.rb
new file mode 100644
index 0000000..c683be3
--- /dev/null
+++ b/help/app/helpers/tickets_helper.rb
@@ -0,0 +1,15 @@
+module TicketsHelper
+
+ def status
+ params[:open_status] || 'open'
+ end
+
+ def admin
+ params[:admin_status] || 'all'
+ end
+
+ def link_to_status(new_status)
+ label = new_status + ' issues'
+ link_to label, :open_status => new_status, :admin_status => admin
+ end
+end