Unresolved reference in view when render action with locals
Answered
action in controller:
def index
render :index, locals: { my_var: 'show me`}
end
In view:
<p><%= my_var %></p>
I get a warning `Cannot find 'my_var'`. It is ok when instead of locals I use an instance variable
@my_var
It should not show this warning when the variable is provided via locals to the view.
Please sign in to leave a comment.
Hello,
we have a related issue on our tracker: https://youtrack.jetbrains.com/issue/RUBY-16193
In case it's similar to yours could you please add your vote there.
Hi Olga,
Yes, it is similar but still, it does not give me a solution to the problem :D.
Unfortunately that's a feature that isn't supported yet so your vote is also important.