<% active_setting_id = @custom_data_field[:setting_id] || @settings.first.id rescue nil %> <% if @settings.length != 0 %>
<%= select_tag("#{@field_name}[custom_data_field][setting_id]", options_for_select(@settings.map.with_index{|setting, i| [t("file_manager.setting",:num=>i+1),setting.id]},active_setting_id),{:id=>"custom_setting_id"})%>
<% end %>