I have the following selection of a collection that acts like a filter in a Rails application.
<%= form_tag( "/appointments", :method => "get", :id => "filter_form") do %>
<%= collection_select :doctor, :id, @doctors, :id, :full_name, {:include_blank => 'All'} %>
<% end %>
This always generates an attribute attribute name for the select element, for example name="doctor[id]", which causes the browser to have ?utf8=✓&doctor%5Bid%5D=1something that is not entirely readable.
How to change name attribute only to name = "doctor"or just remove brackets from it?
source
share