Uncaught TypeError: Object [object Object] не имеет метода quicksand

Я приобрел шаблон начальной загрузки и пытался интегрировать его в свое приложение Rails.

У меня есть несколько кнопок в списке неупорядоченных:

<ul class="filter-nav">
  <li class="active"><a data-id="all" href="">All</a></li>
  <% @categories.each do |category| %>
    <li><a data-id="<%= category.name %>" href=""><%= category.name %></a></li>
  <% end %> 
</ul>

Которые при нажатии сортируют изображения:

<ul class="thumbnails" id="thumbnails">

<table>
  <% @designs.each_with_index do |d, i| %>
  <% strcategory =  Category.find(d.category) %>
  <% if i % 4 == 0 %>
  <tr>
    <% end %>
    <td>
      <li class="span3" data-id="<%=i+1%>" data-type="<%= strcategory.name %>">
        <a href="<%=d.image_url.to_s%>" class="thumbnail">
          <img src="<%=d.image_url(:thumb).to_s%>" alt="<%= d.name %>" />
          <span class="caption"><i class="icon-plus-sign"></i></span>
        </a>
        <% if current_user %>
        <%= link_to 'edit', edit_design_path(d) %> | <%= link_to 'delete',  d,  method: :delete, data: { confirm: 'Are you sure?' } %>
        <% end %>
      </li>
    </td>
    <% if i % 4 == 3 %>
    </tr>
    <% end %>
    <% end %>
  </table>

</ul>

Когда я нажимаю кнопку, я получаю эту ошибку: Uncaught TypeError: Object [object Object] не имеет метода 'quicksand' в файле photographer.js (в первой строке):

        $thumbnails.quicksand($filteredData, {
      duration: 800,
      easing: 'easeInOutQuad'
    }, function() {
        Shadowbox.setup("a.thumbnail");
    });

    $('.filter-nav li').removeClass('active');
    $(this).parent().addClass('active');

    return false;

});

Я включаю jquery.quicksand.js (версия 1.2.2) в папку assets/javascripts. У кого-то еще была похожая проблема, и решение было удалить вторую копию jQuery. I am not sure if I include a second jQuery file, at least there is not any in my assets. Just the jquery.quicksand.js and jquery.easing.js. Well, I tried removing those two files but this didn't solve the problem (if that is what I was suppose to do).

Here is also my gemfile just for the record:

gem 'rails', '4.0.2'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass', '~> 2.3.2.2'
gem 'devise'
gem 'figaro'
gem 'simple_form'
gem 'carrierwave'
gem 'rmagick'
gem 'thin'

Let me know if you have any clue of whats wrong or if you need any other information. Thank you for your effort looking this up for me.

0 ответов

Другие вопросы по тегам