In my bar.html I render a partial view and in it I want to call the method foo(var1, var2) and get an array back. On my local system everything works finde but on my production system the following error occurs.
undefined local variable or method `foo' for #<#<Class:0x70c6410>:0x706f480>)
Can someone explain this to me?
The Class #<#:0x706f480> changes with every call so it seems that the view does not try to search the function in my helper.
EDIT:
The application has the following structure (example)
app/helpers/bar_helper
app/views/bar/bar.html.erb
app/views/bar/partials/bar_partial.html.erb
and in bar_partial.html.erb I call foo(var1, var2) in my bar_helper like this
<% data = foo(var1, var2) %>
The problem was, that the class existed a second time somewhere in the folder structure so that ruby found the first file and used that one instead of the right one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With