Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4597522
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:16:09+00:00 2026-05-21T23:16:09+00:00

I know some will think that i should use form_tag with :remote=>true, but i

  • 0

I know some will think that i should use form_tag with :remote=>true, but i don’t know how to render an entire html output….

My problem is the following:

I have this form that sends a collection through 3 comboxes

<%= form_remote_tag :url => report_client_reports_path, :update => :graphic do%>
<%#= form_tag reporte_client_reports_path%>
 <p><%= label_tag :supermercados %>
 <%=select_tag "supermercados[]", options_from_collection_for_select(@supermercados, "id", "name"),{:multiple=>true, :id => "supermarkets"}%>
 </p>

  <p><%= label_tag :cortes %>
<%=select_tag "cortes[]", options_from_collection_for_select(@cortes, "corte_real","cuts"),{:multiple=>true, :id => "cortes"}%>
 </p>

 <p><%= label_tag :productos %>
 <%= select_tag "productos[]", options_from_collection_for_select(@productos, "id", "name"),{:multiple=>true, :id => "products"}%>
</p>


<p><%= submit_tag 'Send' %></p>
<%end%> 

If i uncommented this line:
<%#= form_tag reporte_client_reports_path%>
It work good and present me the graph, but not the way i expect to work.

I have detected that using form_remote_tag, it sends all vars with their values, bu i dont know why my controller only see one value of each variable.

here is the controller:

  @super = params[:supermarkets]
  @superm = []
  @super.each do |s|
    @superm << Company.find(s).abbr
  end

  @cuts = params[:cuts]
  @prods = params[:products]
  @cortesGraph = []

  @cortess.to_a.each do |c|
   @cortesGraph  << "#{RawData.find_by_real_cut(c).cuts}"
  end 

The objects @superm,@cuts and @products arent receving more than 1 value in the array, is a routing problem or a option i have missed in the form_remote_tag?


And update to simplyfy, what actually is still happening is this:

This Works:

<%= form_tag reporte_client_reports_path do%>

This doesn’t:

<%= form_tag reporte_client_reports_path,:remote=>true do%>

The problem is that :remote is not sending my params as array it send all data as 1 var :s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:16:10+00:00Added an answer on May 21, 2026 at 11:16 pm

    I resolved in functional way, but there might be something very weird with this in my controller:

     if request.xhr?
        @super = params[:supermercados].to_s.split(",")
        @cortess = params[:cortes].to_s.split(",")
        @prods = params[:productos].to_s.split(",")
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if any of you know some libraries that will help/improve the
I want to know if Netbeans has some option or setting that will allow
as we know, return keyword will RETURN some value and exit current function. Mean,
I know in Java, when using PreparedStatement with parameters, some JDBC drivers will optimize
I know some SEO, but I have to ask: Is it unnecessary to add
I do know some basic differences but there are still some questions in my
Let me begin by saying this; I know that similar questions exist, but they
I don't know if this question will make sense to begin with... Example Given:
OK, I don't do much .Net programming, but I do have one that I
I think that I fully understand this, but I just want to make sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.