# Alpha pager?

**URL:** <https://www.ruby-forum.com/t/alpha-pager/88322>\
**Category:** Rails\
**Created:** [March 9, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/alpha-pager/88322 "2007-03-09T18:12:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [March 9, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/alpha-pager/88322/1 "2007-03-09T18:12:19Z")

</div>

is there such thing as an alphabetical pager helper or plugin?  
or even a how-to article?  
googling comes up empty for me  
tia  
linoj

---

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [March 9, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/alpha-pager/88322/2 "2007-03-09T18:18:19Z")

</div>

You mean sending/texting to pagers/phones?

> **[SMS gateway](https://en.wikipedia.org/wiki/SMS_gateways)**
>
> An SMS gateway or MMS gateway allows a computer (also known as a Server) to send or receive text messages in the form of Short Message Service (SMS) or Multimedia Messaging Service (MMS) transmissions between local and/or international telecommunications networks. In most cases, SMS and MMS are eventually routed to a mobile phone through a wireless carrier. SMS gateways are commonly used as a method for person-to-person to device-to-person (also known as application-to-person) communications. Man...

has email addys for most carriers…

* * *

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jonathan L.  
Sent: Friday, March 09, 2007 9:07 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Rails] alpha pager?

is there such thing as an alphabetical pager helper or plugin?

or even a how-to article?

googling comes up empty for me

tia

linoj

---

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [March 9, 2007, 7:09pm UTC](https://www.ruby-forum.com/t/alpha-pager/88322/3 "2007-03-09T19:09:44Z")

</div>

Hello,

On 9 Mar 2007, at 17:06, Jonathan L. wrote:

> is there such thing as an alphabetical pager helper or plugin?  
> or even a how-to article?  
> googling comes up empty for me

Assuming you’re after a way of paginating by first letter, here are a  
few lines of code which I wrote to do this:

routes.rb:

map.customers ‘customers/:letter’, :controller =\>  
‘customers’, :letter =\> /[a-zA-Z]/

customers\_controller.rb:

def index  
# Paginate alphabetically by surname.  
if params[:letter] =~ /^[A-Z]$/i  
letter = params[:letter].upcase  
else  
letter = ‘A’  
end  
@customers = Customer.all\_by\_name “contacts.last\_name like ‘#  
{letter}%’” # My customers table is joined to my contacts table  
end

customers\_helper.rb:

def glossary\_index(params)  
result = “

”  
(‘A’…‘Z’).to\_a.each { |letter|  
result \<\< link\_to\_unless\_current(letter, url\_for(params.merge  
(:letter =\> letter))) {  
“#{letter}”  
}  
}  
result \<\< ‘

’  
end

stylesheet.css:

p.glossary-index a { margin: 0.6em; }  
p.glossary-index span { margin: 0.6em; }

index.rhtml:

\<%= glossary\_index :controller =\> ‘customers’ %\>

\<% for customer in @customers %\>  
…  
\<% end %\>

Hope that helps.

Regards,  
Andy S.
