Pass an array through params #974

Closed
exAspArk opened this Issue Oct 17, 2013 · 1 comment

Comments

Projects
None yet
2 participants

Hi! How may I pass the array of arrays to collection?

When I'm trying to do like this:

f.input :ids_in, as: :check_boxes, collection: [
  ['arr1', [1, 2, 3]],
  ['arr2', [4, 5, 6]]
]

I get ids = ["1 2 3"].

Maybe formtastic could recognize the array and somehow populate the inputs?

if choice.kind_of?(Array)
  choice.each do |choice_item|
     builder.check_box_tag(...) 
     # hidden_field_tag 'model[ids][]', value, id: "model_ids_#{value}"
  end
end
Owner

justinfrench commented Apr 5, 2014

I'm not exactly sure what you're expecting as HTML output. If you could create a pull request with a few failing specs to illustrate your idea, I'd be happy to help make progress. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment