From be479d2c55d502c6e4303700b68e0a619f646834 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 27 Nov 2012 10:01:07 +0100 Subject: 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 --- help/app/helpers/tickets_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 help/app/helpers/tickets_helper.rb (limited to 'help/app/helpers/tickets_helper.rb') 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 -- cgit v1.2.3