nested attributes and haml engine #35

bl4d3 opened this Issue Jun 6, 2011 · 0 comments


None yet
1 participant

bl4d3 commented Jun 6, 2011

Hi, I was working with nested attributes (something like this and I had this error

undefined method `reflect_on_association' for NilClass:Class

I generated haml template with amazing gem but I figured out that into a generic new.html.haml a symbol is used into the form and this generate the error up here on this line

= link_to_add_fields "Add Zone", f, :zones

  = form_for :company, :url => companies_path, :html => { :class => :form } do |f|
    = render :partial => "form", :locals => {:f => f}

so I used this

  = form_for @company, :url => companies_path, :html => { :class => :form } do |f|

and it works fine.

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