selection ???

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 =
      output_path = "#{RAILS_ROOT}/public/converter/output/output.xml"
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

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

<% templateOptions = ""
            @templates_array.each do |i|
              templateOptions = templateOptions + "<option

           <%=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 + "<option
value=#{i}>#{i}</option><option value=csv>csv</option>"

thanks for any help or comments