ruby on rails - undefined method `stringify_keys' for false:FalseClass -
gives me error code
module spree::admin::productshelper def stores_checkbox capture spree::store.all.each |store| concat hidden_field_tag "product[store_ids][]", store.id, @product.stores.include?(store) end end end end but ok one....
module spree::admin::productshelper def stores_checkbox capture spree::store.all.each |store| concat check_box_tag "product[store_ids][]", store.id, @product.stores.include?(store), :style => "display: none;" end end end end what's problem?
change this:
hidden_field_tag "product[store_ids][]", store.id, @product.stores.include?(store)
to:
hidden_field_tag "product[store_ids][]", store.id
the issue: hidden_field_tag expecting hash it's lastly parameter, passing in false (boolean).
the alter suggest add together product store_id hidden field on form, it's value set store.id.
you can read more hidden_field_tag here.
ruby-on-rails ruby helper
No comments:
Post a Comment