Ruby on Rails
Wednesday, May 7, 2014
Hi guys,
-- I've been coding in rails for a while now but I've never been able to render fields_for as a partial. I don't know if this is possible, as it should be dead simple. Normally when I run across this problem, I just find another way to do it.....but sadly, it's time to pay the piper....any help would be greatly appreciated.
My code looks like so:
#form.html.haml
=render partial: "html_panel_fields", locals:{f: f}
and my partial looks like this
#_ html_panel_fields.html.haml
= f.simple_fields_for :html_panels do |o|
my error is as follows:
undefined local variable or method `f' for #<#<Class:0x007fdf7077c8e0>:0x007fdf72175738>
It looks like I have two classes embedded here......what gives?
Thanks!
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ff2e4c06-15b2-43fc-95b4-57224390da42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment