<% if @connect.errors.any? %> <% errors = "" %> <% @connect.errors.messages.values.each_with_index { |message, index| errors = errors + "#{index+1}.#{message.join(";")}; " } %>
<%= errors %>
<% end %>

数据库链接池管理

数据库链接池管理

<%= form_for(@connect) do |f| %>
<%= f.text_field :name, class: "form-control", placeholder: "name" %>
<%= f.select :adapter, options_for_select(Treport::Db.adapter_options, @connect.adapter), {}, class: "form-control" %>
<%= f.text_field :database, class: "form-control", placeholder: "database" %>
<%= f.text_field :username, class: "form-control", placeholder: "username" %>
<%= f.text_field :password, class: "form-control", placeholder: "password" %>
<%= f.text_field :host, class: "form-control", placeholder: "host" %>
<%= f.text_field :port, class: "form-control", placeholder: "port" %>
<% end %>