public
Fork of defunkt/exception_logger
Description: Don't use this fork, instead use the original by defunkt as that has these changes merged in.
Homepage:
Clone URL: git://github.com/ryanb/exception_logger.git
exception_logger / lib / logged_exceptions_helper.rb
100644 25 lines (22 sloc) 0.754 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module LoggedExceptionsHelper
  def filtered?
    [:query, :date_ranges_filter, :exception_names_filter, :controller_actions_filter].any? { |p| params[p] }
  end
 
  def pagination_remote_links(collection)
    will_paginate collection,
      :renderer => 'LoggedExceptionsHelper::PaginationRenderer',
      :prev_label => '',
      :next_label => '',
      :container => false
  end
 
  class PaginationRenderer < WillPaginate::LinkRenderer
    def page_link_or_span(page, span_class = 'current', text = nil)
      text ||= page.to_s
      if page and page != current_page
        @template.link_to_function text, "ExceptionLogger.setPage(#{page})"
      else
        @template.content_tag :span, text, :class => span_class
      end
    end
  end
end