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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
alphabet = ''A''..''Z'' alphabet.each |letterl do #your code here end is this what you you need? On Dec 7, 2007, at 3:06 PM, Drew Tempelmeyer wrote:> > 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? > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Breen 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| -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 maybe? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Credit belongs to http://shanti.railsblog.com/. I saw this on his blog. On Dec 7, 2007, at 5:03 PM, Drew Tempelmeyer wrote:> > Michael Breen 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| > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---