I am new to SOF and if my question is not clear or there is any other problem, please do mention it instead of rating me down which happened at the only question I asked 4 months ago and had to remove it. Before I start, I must mention that I have seen around a dozen of similar questions asked here but none answered my own problem exactly.
I am trying to pass an array of hashes in a hidden_field_tag in a form but what I am getting is a string. What is surprising is that before being sent to the controller, the array had already changed to a string before being assigned to the field. I have no clue at all when and where it happened. I am explaining the scenario in detail in "background" section.
I have a page which shows data according to a city but due to some requirement I have to keep track of all the cities alongside. I passed the cities' data in an array and it works fine for the page but I have a "filters" system for searching specific data. The filters are in a form in a partial which submits to the url and the page loads with the new data. For filters, the cities need to be passed too. I added hidden_field_tag for all data that needs to be passed. Rest of the data goes fine (e.g. id, city, category etc.) but the cities array gets converted to a string. I tried using hidden_field and multiple=true but did not work or I probably used them with wrong syntax.
= hidden_field_tag :cities, @cities
= hidden_field_tag :longitude, params[:longitude]
= hidden_field_tag :address, params[:address]
= hidden_field_tag :category, params[:category]
= hidden_field_tag :city, @city
= hidden_field_tag :state, @state
= hidden_field_tag :category, @category
= hidden_field_tag :user_id, @user.id