<%= content_for :search_bar do  %>
  <%= render 'shared/search_bar' %>
<% end %>

<%= content_for :filter_menu do  %>
  <%= render 'shared/filter_menu' %>
<% end %>

<article id="monster-list" class="pt5 mt5">
  <%= render 'monsters/empty', empty: false %>
</article>

<script type="text/javascript">
  if (localStorage.hasOwnProperty('favourites') == true &&
    "<%= @monster_set.slug.html_safe %>" in JSON.parse(localStorage.getItem('favourites'))) {
    $.ajax({
      url: "/favourites/fetch",
      data: {favourite_monsters: JSON.parse(localStorage.favourites)["<%= @monster_set.slug.html_safe %>"]},
      success: function (data, response) {
        $('article#monster-list').append(data);
        filters.init();
        favourites.init({set:"<%=@monster_set.slug.html_safe%>"});
      },
    });
  };
</script>

<%= content_for :search_bar do  %>
  <%= render 'shared/search_bar' %>
<% end %>

<%= content_for :filter_menu do  %>
  <%= render 'shared/filter_menu' %>
<% end %>

<article id="monster-list" class="pt5 mt5">
  <%= render 'monsters/empty', empty: false %>
</article>

<script type="text/javascript">
  if (localStorage.hasOwnProperty('favourites') == true &&
    "<%= @monster_set.slug.html_safe %>" in JSON.parse(localStorage.getItem('favourites'))) {
    $.ajax({
      url: "/favourites/fetch",
      data: {favourite_monsters: JSON.parse(localStorage.favourites)["<%= @monster_set.slug.html_safe %>"]},
      success: function (data, response) {
        $('article#monster-list').append(data);
        filters.init({
          crXp: <%= Monster::CR_XP.to_json.html_safe %>,
        });
        favourites.init({set:"<%=@monster_set.slug.html_safe%>"});
      },
    });
  };
</script>

Initialize filter on favourites index with crxp map.
Initialize filter on favourites index with crxp map.
