mardi 4 août 2015

Rails Rendering Partial With a Local Variable

I need some help with a test application I am working on. I have this line repeated multiple times in my application so I decided to render it out as a partial. When I do I get an error saying that it isn't seeing the local variable. Here is what's happening:

= simple_form_for ([@user, @dogs]) do |b| 
        = render 'dogs/dogs-cats-partials/newupload', :dog => b, :user => b

Here's whats inside the partial

.form-group.required
  = b.input :title, autofocus: true, :class => "form-control", :required => false
.form-group.required
  = b.input :description, autofocus: false, :class => "form-control", :required => false

Here is the exact Error:

undefined local variable or method `b' for #<#<Class:0x007f2ae1d8a5a0>:0x007f2ae1b4dc60>

Thank you in advance for anyone who can help... been stuck on this for an hour : )



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire