Permalink
Browse files

adding if_first & unless_first

  • Loading branch information...
1 parent c5a72f1 commit 0d1b25776fe51efbce578c14a90bbc9c6ac176fe @jomz jomz committed Jan 22, 2009
Showing with 14 additions and 0 deletions.
  1. +14 −0 app/models/paginate_tags.rb
@@ -65,6 +65,20 @@ def page_span(page, text, attributes = {})
end
desc %Q{
+ Expands when this is the first child in paginate:each
+ }
+ tag 'paginate:each:if_first' do |tag|
+ tag.expand if tag.locals.index == 0
+ end
+
+ desc %Q{
+ Expands unless this is the first child in paginate:each
+ }
+ tag 'paginate:each:unless_first' do |tag|
+ tag.expand unless tag.locals.index == 0
+ end
+
+ desc %Q{
Renders pagination links with will_paginate.
}
tag 'paginate:pages' do |tag|

0 comments on commit 0d1b257

Please sign in to comment.