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%>
<p>
<%= label_tag :cuts %>
<%= select_tag "cuts[]", options_from_collection_for_select(@cuts,
"real_cut", "cut"), :multiple=>true, :id => "cuts"%>
</p>
<p>
<%= submit_tag 'Send' %>
</p>
<%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
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.