RailsCasts Pro episodes are now free!

Learn more or hide this

Rutger Laurman's Profile

GitHub User: lekkerduidelijk

Site: http://lekkerduidelijk.nl

Comments by Rutger Laurman

Avatar

I was trying this in Ruby 2, with Rails 4.

The attr_attributes no longer works. Permitting the :fields_attributes didn't cut it, since there is an unknown number of fields. See this

I ended up permitting all parameters with:
params.require(:product_type).permit!

I know it's not safe to do so. If somebody knows a proper way to validate the product type params I would love to hear it.