Skip to content

Commit

Permalink
47 Move BootstrapPaginationRenderer to ApplicationController
Browse files Browse the repository at this point in the history
  • Loading branch information
id774 committed Jan 24, 2013
1 parent 53bf4b7 commit 41b1585
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
21 changes: 21 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -17,3 +17,24 @@ def error_404
"
end
end

class BootstrapPaginationRenderer < WillPaginate::ActionView::LinkRenderer
private
def previous_or_next_page(page, text, classname)
link(text, page, :class => classname) unless page == false
end

public
def to_html
html = pagination.map do |item|
tag(:li,
((item.is_a?(Fixnum))?
page_number(item) :
send(item)))
end.join(@options[:link_separator])

html = tag(:ul, html)

@options[:container] ? html_container(html) : html
end
end
21 changes: 0 additions & 21 deletions app/controllers/statuses_controller.rb
Expand Up @@ -32,24 +32,3 @@ def authenticate
end
end
end

class BootstrapPaginationRenderer < WillPaginate::ActionView::LinkRenderer
private
def previous_or_next_page(page, text, classname)
link(text, page, :class => classname) unless page == false
end

public
def to_html
html = pagination.map do |item|
tag(:li,
((item.is_a?(Fixnum))?
page_number(item) :
send(item)))
end.join(@options[:link_separator])

html = tag(:ul, html)

@options[:container] ? html_container(html) : html
end
end

0 comments on commit 41b1585

Please sign in to comment.