Module: FlexaLib::Helpers::PaginateHelpers

Included in:
FlexaLib::Helpers
Defined in:
lib/flexa_lib/helpers/paginate_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flexa_will_paginate(resource, *args) ⇒ Object

PAGINATE_HELPERS



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/flexa_lib/helpers/paginate_helpers.rb', line 6

def flexa_will_paginate(resource,*args)
  options = args.extract_options!
  options[:page_links] = true if options[:page_links].present?
  options[:previous_label] = ("i"," ",:class=>"icon-arrow-left")
  options[:next_label] = ("i"," ",:class=>"icon-arrow-right")
  new_options = options
  begin       
    flexa_wp = will_paginate resource, new_options 
  rescue
    ""
  end
  begin       
    flexa_wp["<ul>"]= "" 
  rescue
    ""
  end
  begin       
    flexa_wp["</ul>"]= ""  
  rescue
    ""
  end
  begin       
    flexa_wp['<div class="pagination">']= "" 
  rescue
    ""
  end
  begin       
    flexa_wp["</div>"]= "" 
  rescue
    ""
  end
  flexa_wp
end