Ruby on Rails Thursday, August 22, 2013

On Aug 22, 2013, at 4:15 PM, Nick Khamis <symack@gmail.com> wrote:

> Hello Tamouse,
>
> Thank you so much for your reply,
>
> Where trying $('#pic').attr('src', "<%= asset_path(wine.picture)%>");, I get the following error:
>
> undefined local variable or method `wine' for #<#<Class:0x4231bdb0>:0x4311bb04>
>
> I hope I did not forget to mention that. wine.picture is a dynamic variable.

It appears that wine is not defined in the scope of that ERB call. How are you passing it to your view?

--
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/A7C9779F-529E-4936-BD94-EF3FCE27F5E1%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment