NN Dodhia
2013-Mar-17 14:24 UTC
Getting information from xls file to show on drop down list in rails
Hey i have an excel file with 2 columns, and i want to get them so that a user can select one of the rows in a drop down list or as an auto complete form, any ideas on how this is done, i know i can type out all the selections using f.input :collection ["1","2"......"100"] but there are about 100 rows so typing it would be tedious. Any help would be appreciated. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/IvH-B81kBfUJ. For more options, visit https://groups.google.com/groups/opt_out.
Dheeraj Kumar
2013-Mar-17 15:02 UTC
Re: Getting information from xls file to show on drop down list in rails
Use an iterator. A loop, if you prefer that term. Google ruby loops to get an overview of different constructs ruby supports. You really should go back to a ruby book On Mar 17, 2013 7:54 PM, "NN Dodhia" <aca10nnd-1V21x8GFL1deXsq7+8kxVA@public.gmane.org> wrote:> Hey i have an excel file with 2 columns, and i want to get them so that a > user can select one of the rows in a drop down list or as an auto complete > form, any ideas on how this is done, i know i can type out all the > selections using f.input :collection ["1","2"......"100"] but there are > about 100 rows so typing it would be tedious. > > Any help would be appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/IvH-B81kBfUJ. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.