New error on random number assigned to local variable , Rails

44 views Asked by At

I'm experimenting with some Bootstrap tabs that render partials, and inside the partials are other nested tabs that could possibly eventually render the same partials, in a never ending maze of Bootstrap tabs. I resolved the issue of certain tabs not working within the maze (because their divs were using the same ID assigned to previous partials) by assigning a random number each time a partial is rendered, and putting the random number as part of the partial's div IDs.

<% asdf = rand(1000000000) %>
<div class="<% order.id %>_<%= @menu.order_type %>_<%= asdf %>">
  <ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#<%= order.id %>_<%= @menu.order_type %>_qwer_general_info_<%= asdf %>"><%= order.qwer_zxcv_name.upcase %>General</a></li>
etc.

However, this morning I woke up and I'm getting Error: No most-recent exception when it assigns a random number to asdf.

I can assign a random number to any other local variable, just not 'asdf' (for the record the local variable in the code is 'wtf').

I researched the error, and Google does not show anything conclusive.

I'm pretty curious as to why this error is appearing today when it was all working perfectly yesterday, if anybody has a hint.

0

There are 0 answers