Skip to content

Instantly share code, notes, and snippets.

@misha354
Created July 23, 2014 23:30
Show Gist options
  • Save misha354/cb914337674425b2f126 to your computer and use it in GitHub Desktop.
Save misha354/cb914337674425b2f126 to your computer and use it in GitHub Desktop.
Problematic Javascript ERB code
<ul class="indented unstyled" id= <%="categories_brief_".concat(origin)%> >
<li class="indented unstyled"><%=link_to 'Add category', new_category_path%></li>
<!--The categories -->
<% for category in @categories %>
<li class='indented'><%= link_to category.name, Rails.application.routes.url_helpers.send( link_path, category) %> </li>
<% end %>
</ul>
undefined local variable or method `origin' for #<#<Class:0x00000102d0edc0>:0x00000103e00de0>
$('<%="#categories_brief_".concat(@source)%>)%>').html(
'<%=escape_javascript(render partial: 'categories_brief', locals: {:link_path => @link_path, :origin=> @origin })%>'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment