# Radius tag from rails helper?

**URL:** <https://www.ruby-forum.com/t/radius-tag-from-rails-helper/126702>\
**Category:** Radiant CMS\
**Created:** [January 21, 2008, 2:52pm UTC](https://www.ruby-forum.com/t/radius-tag-from-rails-helper/126702 "2008-01-21T14:52:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mariano\_Viola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Mariano\_Viola](https://www.ruby-forum.com/u/Mariano_Viola)\
**Post date:** [January 21, 2008, 2:52pm UTC](https://www.ruby-forum.com/t/radius-tag-from-rails-helper/126702/1 "2008-01-21T14:52:06Z")

</div>

Hi all,  
I’ve created an extension that use the rails “paginating find” plugin  
“[Welcome cardboardrocket.com - BlueHost.com](http://cardboardrocket.com/pages/paginating_find)” and it work well on  
the controller side.  
But at this point can I create a radius tag that wrap the  
paginating\_links() method exposed from the helper (already activated  
in my extension) that generate automatically the pagination?

Thanks,  
Mariano

---

<div class="post-metadata">

**Author:** ![Mariano\_Viola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Mariano\_Viola](https://www.ruby-forum.com/u/Mariano_Viola)\
**Post date:** [January 21, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/radius-tag-from-rails-helper/126702/2 "2008-01-21T15:41:08Z")

</div>

The only case where you would want to do that is if you wanted to  
generate the links inside a page (not a regular view). Is that what  
you’re trying to do? If not, just use the helper as-is in your views.

Sean

---

<div class="post-metadata">

**Author:** ![Mariano\_Viola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Mariano\_Viola](https://www.ruby-forum.com/u/Mariano_Viola)\
**Post date:** [January 21, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/radius-tag-from-rails-helper/126702/3 "2008-01-21T16:33:05Z")

</div>

Yes I want generate the links of pagination for my “Bookshelf”  
extension in a radiant page with a custom tag like this  
“\<r:books:paginate /\>” that work like paginating\_links() in a standard  
rails rhtml view.

This is the code of bookshelf\_tags.rb:

module BookshelfTags  
include Radiant::Taggable

tag ‘books’ do |tag|  
tag.expand  
end

tag ‘books:each’ do |tag|  
result = []  
Book.find(:all, :page =\> { :start =\> 1, :current =\> 2, :size =\> 6  
}).each do |book|  
tag.locals.book = book  
result \<\< tag.expand  
end  
result  
end

tag ‘books:each:book’ do |tag|  
book = tag.locals.book  
%{

### #{book.title}

**#{book.sub\_title}**

pub year: #{book.pub\_year} - data form year: #{book.data\_from\_year} - to year: #{book.data\_to\_year}

} end

tag ‘books:paginate’ do |tag|  
book = tag.locals.book  
%{???}  
end

end

And this is the code that I’ve used in my library page:

\<r:books:each\>  
\<r:book /\>  
  
\</r:books:each\>

\<r:books:paginate /\>

Mariano
