I have a change avatar popup in my ruby on rails application. I'm trying to use it for several models like changing profile picture or picture of a product.
I have created a view and trying to open it with parameters as follows in the user.html.erb file:
<div id="myModal_change_avatar" class="modal-dialog fade-scale">
<div class="modal-content">
<div style="height: 100%;width: 100%" id="id_model_content">
<%= render partial: 'change_avatar/index', locals: { par:'param'} %>
</div>
</div>
</div>
In my _index.html.erb file which is located under views/change_avatar:
<h1><%= par %></h1>
But, I get "undefined local variable or method `par' for" when I open user.html.erb file.
I can't see what I'm missing.
Any suggestions ?
Thanks.
parin the partial or the parent file. Where the error is happening in the chain should tell you more about what the problem is.