# Creating an alphabetic list

**URL:** <https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469>\
**Category:** Rails\
**Created:** [December 7, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469 "2007-12-07T21:06:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewtempelmeyer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@drewtempelmeyer](https://www.ruby-forum.com/u/drewtempelmeyer)\
**Post date:** [December 7, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469/1 "2007-12-07T21:06:53Z")

</div>

I’m wishing to create an alphabetic list in Rails so it’s not necessary  
to hard code a block of code that would generate links to find records  
that being with A, or B, or C, etc

Basically, I want to create an alphabetic list. Maybe it’s simple and  
I’m looking for something difficult?

---

<div class="post-metadata">

**Author:** ![drewtempelmeyer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@drewtempelmeyer](https://www.ruby-forum.com/u/drewtempelmeyer)\
**Post date:** [December 7, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469/2 "2007-12-07T21:51:55Z")

</div>

> I’m wishing to create an alphabetic list in Rails so it’s not necessary  
> to hard code a block of code that would generate links to find records  
> that being with A, or B, or C, etc
> 
> Basically, I want to create an alphabetic list. Maybe it’s simple and  
> I’m looking for something difficult?

[http://agilewebdevelopment.com/plugins/alphabar](http://agilewebdevelopment.com/plugins/alphabar)

maybe?

---

<div class="post-metadata">

**Author:** ![drewtempelmeyer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@drewtempelmeyer](https://www.ruby-forum.com/u/drewtempelmeyer)\
**Post date:** [December 7, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469/3 "2007-12-07T22:18:18Z")

</div>

alphabet = ‘A’…‘Z’

alphabet.each |letterl do  
#your code here  
end

is this what you you need?

---

<div class="post-metadata">

**Author:** ![drewtempelmeyer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@drewtempelmeyer](https://www.ruby-forum.com/u/drewtempelmeyer)\
**Post date:** [December 8, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469/4 "2007-12-08T20:32:37Z")

</div>

Credit belongs to [http://shanti.railsblog.com/](http://shanti.railsblog.com/). I saw this on his blog.

---

<div class="post-metadata">

**Author:** ![drewtempelmeyer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@drewtempelmeyer](https://www.ruby-forum.com/u/drewtempelmeyer)\
**Post date:** [December 7, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/creating-an-alphabetic-list/122469/5 "2007-12-07T23:03:48Z")

</div>

Michael B. wrote:

> alphabet = ‘A’…‘Z’
> 
> alphabet.each |letterl do  
> #your code here  
> end
> 
> is this what you you need?

Thanks Michael. Got it to work with  
alphabet.each do |letter|
