# Where to put code for my own paginator?

**URL:** <https://www.ruby-forum.com/t/where-to-put-code-for-my-own-paginator/117774>\
**Category:** Rails\
**Created:** [October 20, 2007, 2:27am UTC](https://www.ruby-forum.com/t/where-to-put-code-for-my-own-paginator/117774 "2007-10-20T02:27:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 20, 2007, 2:27am UTC](https://www.ruby-forum.com/t/where-to-put-code-for-my-own-paginator/117774/1 "2007-10-20T02:27:15Z")

</div>

I had to make my own pagination class in SQL Server. What I am  
wondering is where is a good place to put the code so that every  
controller and template can have access to it ?  
Right now I have put it in application.rb, the controller base class.  
This seems to work well, I did a project last summer where I put stuff  
in the lib directory. The only problem with that is that if you change  
any code at all in the lib directory, it seems you have to restart the  
server or at least if you use webbrick. Anyway, if anyone thinks there  
is a better choice let me know …

Also, I wish ruby allowed something like /\* \*/ for comment blocks,  
=begin =end seems kind of verbose …

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 26, 2007, 6:44pm UTC](https://www.ruby-forum.com/t/where-to-put-code-for-my-own-paginator/117774/2 "2007-10-26T18:44:50Z")

</div>

you can make a plugin. it’s surelly the better idea about where to put  
the code…

On Fri, 2007-10-19 at 17:26 -0700, removed\_email\_address@domain.invalid wrote:

> Also, I wish ruby allowed something like /\* \*/ for comment blocks,  
> =begin =end seems kind of verbose …
> 
> >

–  
Carlos JÃºnior  
removed\_email\_address@domain.invalid  
Boa Noite BH - Os melhores momentos da noite  
+55 31 87635606

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 27, 2007, 3:44am UTC](https://www.ruby-forum.com/t/where-to-put-code-for-my-own-paginator/117774/3 "2007-10-27T03:44:11Z")

</div>

Hi

Placing it in applicaton.rb is a good choice…

CCH

> **[Rails... Rails... Rails](http://cch4rails.blogspot.com)**
>
> Chee Chong Hwa aka CCH, a Malaysian Chief Software Architect blogs on his experiences with Ruby on Rail running on Win2003 Server+Apache 2.26 environment since 2007. Flirted briefly with Ubuntu 9.04 in 2009. Since January 2017, now using RubyMine...
