3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/helpers/imports_helper.rb', line 3
def import_page_controller import, offset, length
if offset > 0
left_path = import_path import, :offset => [ 0, offset - length ].max, :length => length
left_classes = "previous btn"
else
left_path = "#"
left_classes = "previous btn disabled"
end
if offset + length < import.rows.count
right_path = import_path import, :offset => offset + length, :length => length
right_classes = "next btn pull-right"
else
right_path = "#"
right_classes = "next btn pull-right disabled"
end
left = link_to "Previous Page", left_path, :class => left_classes
right = link_to "Next Page", right_path, :class => right_classes
left + right
end
|