RailsCasts Pro episodes are now free!

Learn more or hide this

Mahendrasinh Rana's Profile

GitHub User: mkr2005

Site: www.tallynine.com

Comments by Mahendrasinh Rana


I am facing undefined method `fields' for #ProductType:0x007ffb8305a100 at http://localhost:3000/products/new?utf8=%E2%9C%93&product_type_id=1

my app/views/products/_form.html.erb file extraction of the lines which are causing the problem

<%= f.fields_for :properties, OpenStruct.new(@product.properties) do |builder| %>
<% @product.product_type.fields.each do |field| %>
<%= render "products/fields/#{field.field_type}", field: field, f: builder %>