# Newbea Selection question

**URL:** <https://www.ruby-forum.com/t/newbea-selection-question/130764>\
**Category:** Rails\
**Created:** [March 3, 2008, 4:19am UTC](https://www.ruby-forum.com/t/newbea-selection-question/130764 "2008-03-03T04:19:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [March 3, 2008, 4:19am UTC](https://www.ruby-forum.com/t/newbea-selection-question/130764/1 "2008-03-03T04:19:41Z")

</div>

Hello RoR Developers,

I got question about selection again. I got template.yml file

id1051256120:

template\_of\_roste1: Name1  
template\_of\_roster2: Name2

I get my selections options from this yml file like,  
controller  
@site\_id=“id”+current\_hierarchy.site\_id.to\_s  
@get\_config=YAML.load(File.open("#{PATH\_IM}/config/template.yml"))  
@get\_config == Hash  
@sites=@get\_config[@site\_id].values  
@merge= @sites  
view  
\<%= select\_tag “templates”,  
options\_for\_select(@merge) %\>

my question here is how can I create selection like

 work\_sheet\_csv1 Name1 Name2 

I want to get the values from first column and the names from second  
column.

thanks

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [March 3, 2008, 6:12am UTC](https://www.ruby-forum.com/t/newbea-selection-question/130764/2 "2008-03-03T06:12:16Z")

</div>

least could somebody tell me where is my mistake.

controller

@site\_id=“id”+current\_hierarchy.site\_id.to\_s  
@get\_config=YAML.load(File.open("#{PATH\_IM}/config/template.yml"))  
@get\_config == Hash  
@merge==Hash  
@merge==@get\_config[@site\_id]

view  
\<%  
templateOptions = “”  
@merge.each do |key,value|  
templateOptions = templateOptions + “#{value}”  
end  
%\>

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [March 3, 2008, 8:20am UTC](https://www.ruby-forum.com/t/newbea-selection-question/130764/3 "2008-03-03T08:20:41Z")

</div>

ok  
this one will be more clear.  
I have a template.yml file, like this  
template:

templatename1: template\_of\_roster  
templatename2: template\_of\_roster1  
templatename3: template\_of\_roster2

template1:

templatename1: template\_of\_roster32  
templatename2: template\_of\_roster143  
templatename3: template\_of\_roster2423

I want to use yaml keys and values in my selection. like,

@get\_config=YAML.load(File.open("#{PATH\_IM}/config/template.yml"))  
@get\_config == Hash

 \<%=@get\_config[template].values%\> 

this one is not my problem actually, I can do it, my problem is

I have two hashes one is

@hash1==Hash  
@hash1=@get\_config[template]

other one is

@hash2==Hash  
@hash2=@get\_config[template1]

I want to merge these two hashes in one and create selection like above.
