Hello i have a lot of time trying to figure this out.
I am having problem sending array params with form_tag :remote=>true
form.erb
<%#= form_tag reporte_client_reports_path do%>
<%= form_tag reporte_client_reports_path,:remote=>true do%>
<%= label_tag :cuts %> <%= select_tag "cuts[]", options_from_collection_for_select(@cuts, "real_cut", "cut"), :multiple=>true, :id => "cuts"%>
<%= submit_tag 'Send' %>
<%end%>Controller
def report
@cuts = params[:cuts]
respond_to do |format|
format.html {render :layout => false if request.xhr?}
format.js #{render :layout => false}
end
end
Results
debug results:
- 2011-02-15,2011-02-28,2011-03-15,2011-03-31
It work if i use
<%= form_tag reporte_client_reports_path do%>
debug results:
- “2011-02-15”
- “2011-02-28”
- “2011-03-15”
- “2011-03-31”
The problem is in remote the form pass the parameters not as a array :s