Uncaught TypeError: Object [object Object] has no method 'quicksand'

101 Views Asked by At

I purchased a bootstrap template and I have been trying to integrate it work on my Rails app.

I have some buttons in an unorder list:

<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>

Which when are clicked are sorting images:

<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>

When I click a button I get this error: Uncaught TypeError: Object [object Object] has no method 'quicksand' on photographer.js file (on the first line):

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

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

    return false;

});

I include jquery.quicksand.js (version 1.2.2) in the assets/javascripts folder. Somebody else had a similar issue and the solution was to remove the 2nd copy of 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

There are 0 best solutions below