# UI drop down list pulled from database values in activescaffold

**URL:** <https://www.ruby-forum.com/t/ui-drop-down-list-pulled-from-database-values-in-activescaffold/118659>\
**Category:** Rails\
**Created:** [October 29, 2007, 9:08pm UTC](https://www.ruby-forum.com/t/ui-drop-down-list-pulled-from-database-values-in-activescaffold/118659 "2007-10-29T21:08:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Selvan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Selvan](https://www.ruby-forum.com/u/Selvan)\
**Post date:** [October 29, 2007, 9:08pm UTC](https://www.ruby-forum.com/t/ui-drop-down-list-pulled-from-database-values-in-activescaffold/118659/1 "2007-10-29T21:08:42Z")

</div>

as i’m finding it difficult to override the form Ui elements using  
activescaffold -= i’m looking for a help to build a drop down list in  
UI (values pulled from databse through SQL query) and so user can  
select these valus while submitting to database.

pls provide any example strictly using activescaffold plugin.

thanks  
selvan-kalaiselvan

---

<div class="post-metadata">

**Author:** ![Selvan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Selvan](https://www.ruby-forum.com/u/Selvan)\
**Post date:** [October 29, 2007, 9:37pm UTC](https://www.ruby-forum.com/t/ui-drop-down-list-pulled-from-database-values-in-activescaffold/118659/2 "2007-10-29T21:37:23Z")

</div>

While I’m sure someone here can help you, please post to  
ActiveScaffold’s  
discussion list, as ActiveScaffold is not part of Rails.

---

<div class="post-metadata">

**Author:** ![Selvan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Selvan](https://www.ruby-forum.com/u/Selvan)\
**Post date:** [October 30, 2007, 1:12am UTC](https://www.ruby-forum.com/t/ui-drop-down-list-pulled-from-database-values-in-activescaffold/118659/3 "2007-10-30T01:12:38Z")

</div>

This is actually very easy using Active Scaffold if you have your  
models setup properly. Here is some example syntax in your  
controller:

active\_scaffold :model\_name do |config|  
config.columns = [:id, :drop\_down\_item, …]  
config.columns[:drop\_down\_item].ui\_type = :select  
end

The key is this line config.columns[:drop\_down\_item].ui\_type = :select  
and specifically .ui\_type = :select …depending on the version of  
active\_scaffold you are using you may have to use form\_ui instead of  
ui\_type. Read the documentation at this address:  
[http://activescaffold.com/docs/api-column](http://activescaffold.com/docs/api-column)

Hope that helps,  
Wes
