Guest User

Untitled

a guest
Apr 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. # Renders Digg/Flickr-style pagination for a WillPaginate::Collection
  2. # object. Nil is returned if there is only one page in total; no point in
  3. # rendering the pagination in that case...
  4. #
  5. # ==== Options
  6. # * <tt>:class</tt> -- CSS class name for the generated DIV (default: "pagination")
  7. # * <tt>:prev_label</tt> -- default: "« Previous"
  8. # * <tt>:next_label</tt> -- default: "Next »"
  9. # * <tt>:inner_window</tt> -- how many links are shown around the current page (default: 4)
  10. # * <tt>:outer_window</tt> -- how many links are around the first and the last page (default: 1)
  11. # * <tt>:separator</tt> -- string separator for page HTML elements (default: single space)
  12. # * <tt>:param_name</tt> -- parameter name for page number in URLs (default: <tt>:page</tt>)
  13. # * <tt>:params</tt> -- additional parameters when generating pagination links
  14. # (eg. <tt>:controller => "foo", :action => nil</tt>)
  15. # * <tt>:renderer</tt> -- class name of the link renderer (default: WillPaginate::LinkRenderer)
  16. # * <tt>:page_links</tt> -- when false, only previous/next links are rendered (default: true)
  17. # * <tt>:container</tt> -- toggles rendering of the DIV container for pagination links, set to
  18. # false only when you are rendering your own pagination markup (default: true)
  19. # * <tt>:id</tt> -- HTML ID for the container (default: nil). Pass +true+ to have the ID automatically
  20. # generated from the class name of objects in collection: for example, paginating
  21. # ArticleComment models would yield an ID of "article_comments_pagination".
  22. #
  23. # All options beside listed ones are passed as HTML attributes to the container
  24. # element for pagination links (the DIV). For example:
  25. #
  26. # <%= will_paginate @posts, :id => 'wp_posts' %>
  27. #
  28. # ... will result in:
  29. #
  30. # <div class="pagination" id="wp_posts"> ... </div>
  31. #
  32. # ==== Using the helper without arguments
  33. # If the helper is called without passing in the collection object, it will
  34. # try to read from the instance variable inferred by the controller name.
  35. # For example, calling +will_paginate+ while the current controller is
  36. # PostsController will result in trying to read from the <tt>@posts</tt>
  37. # variable. Example:
  38. #
  39. # <%= will_paginate :id => true %>
  40. #
  41. # ... will result in <tt>@post</tt> collection getting paginated:
  42. #
  43. # <div class="pagination" id="posts_pagination"> ... </div>
  44. #
Add Comment
Please, Sign In to add comment