# Selection?

**URL:** <https://www.ruby-forum.com/t/selection/128010>\
**Category:** Rails\
**Created:** [February 4, 2008, 7:14am UTC](https://www.ruby-forum.com/t/selection/128010 "2008-02-04T07:14:25Z")\
**Posts on this page:** 1\
**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:** [February 4, 2008, 7:14am UTC](https://www.ruby-forum.com/t/selection/128010/1 "2008-02-04T07:14:25Z")

</div>

Hi Rails Developers

I want to select template from my folder and add it like a parameter.  
the plugin needs parameter like a template\_path. I want to supply it  
from selection and selection get datas from folder.

template\_path =  
“#{get\_plugin\_root}/public/converter/templates/#{params[:template]}.xml”  
output\_path = “#{RAILS\_ROOT}/public/converter/output/output.xml”

sheet\_id=current\_project.work\_sheet.id  
date= current\_project.from\_date.to\_s  
converter\_generate(sheet\_id,date, output\_path, template\_path) #this is  
method in my plugin.

I have a array to get templates  
@templates\_array = get\_templates  
“#{get\_plugin\_root}/public/converter/templates/”

till here looks no problem but when I pass to view page it gives me  
error.

\<% templateOptions = “”  
@templates\_array.each do |i|  
templateOptions = templateOptions + “#{i}”  
end

```
       <%=select_tag "template", templateOptions %>

```

error : undefined method `each’ for nil:NilClass

could you pls tell me where the error is ?

and also I tried to add new value in selection but couldnt do it. it  
creates 4 csv option…  
\<% templateOptions = “”  
@templates\_array.each do |i|  
templateOptions = templateOptions + “#{i}csv”  
end

thanks for any help or comments
