On 7 May 2014 11:26, bertly_the_coder <muchira@gmail.com> wrote:
> 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>
In the text you said you could not use fields for, but in the example
you are using simple_fields_for. Please clarify.
Is it only if you use f in another way in the partial is it ok? In
other words is it anything to do with fields for at all?
Can you confirm that the it is the line in the partial that is
failing, not the render line?
Colin
--
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/CAL%3D0gLvwW0EYkBssndwityiCSfiho%2BU1c32cbzOYAsjL-%3DoGXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment