GUI - lists, drop-down menus and all that

Hello,

Can anyone please point me in the right direction -

I would like the user to be able to select options from drop down menus
and for the app to get the information from the database.

Where do I find out about GUI stuff??

Chris

Chris F. wrote:

Hello,

Can anyone please point me in the right direction -

I would like the user to be able to select options from drop down menus
and for the app to get the information from the database.

Where do I find out about GUI stuff??

Chris

Chris,

I suggest acts_as_enumerated for a plugin. Create a list of values
table (or whatever) with key | value pairs and use it to generate your
list. The view code would then look something like this (taken from my
app):

				<td width="20%" valign="top" class="dataField">
					<%= select (:order, :order_status, OrderStatus.all.collect {|s| [ 

(s.value), s.value ]}, { :include_blank => true } %>

In this example, OrderStatus is the type I setup per the instructions
via acts_as_enumerated.

This caches the values so you aren’t doing a lookup every time. If you
need the lookup done every time then this isn’t a good solution for you.
I use it for status values, state picklists, etc… Basically, anything
that doesn’t change frequently.

Regards,

Michael

Hello,

does anybody know how to strip diacritic from some text in rails?

I need to define it in somemodel/to_def method

Thank you
tom

Tomas Meinlschmidt, SBN3, MCT, MCP, MCP+I, MCSE, NetApp Filer & NetCache
gPG: CB78 76D9 210F 256A ADF4 0B02 BECA D462 66AB 6F56 / $ID: 66AB6F56
GCS d-(?) s: a- C++ ULHISC*++++$ P+++>++++ L+++$>++++ E— W+++$ N++(+)
!o !K w(—) !O !M V PS+ PE Y+ PGP++ t+@ !5 X? R tv b+ !DI D+ G
e>+++ h---- r+++ z+++@

novy pohled na svicky: http://www.lightgems.cz