mercredi 8 juillet 2015

Can't Load JS File undefined method `javascript_link_tag'

Im sure this is simple to fix but i've been on the problem for 2 hours now.

All im trying to do is load my User Index View which has a boostrap table. In the view i have it loading some JS files.

When i try to try to access it through my broswer i receive this error.

Anyone have any clues how to fix it and have the JS files load?

undefined method `javascript_link_tag'

Here is my User Index View

<%= javascript_link_tag 'dataTables.bootstrap.js' %>
<%= javascript_link_tag 'jquery.dataTables.min.js' %>
<%= javascript_link_tag 'jquery-1.11.1.min.js' %>


<div class="page-header">
  <h1><%= @user.username %> <small>Edit Items</small></h1>
</div>


<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
  <thead>
    <tr>
        <th>Image</th>
        <th>Title</th>
        <th>Price</th>
        <th>Actions</th>
    </tr>
  </thead>
  <tbody>
    <% @item.each do |item| %>
      <tr>
          <td><div class ="small_fifty_image"><%= image_tag item.image.url(:thumb) %></div></td>
          <td><h4><%= link_to item.title, item_url(item.id) %></h4></td>
          <td>$<%=item.price %></td>
          <td>
          <button type="button" class="btn btn-default btn-sm"><%= link_to "Edit Items", edit_item_path(item) %></button>
          <button type="button" class="btn btn-default btn-sm"><%= link_to "Delete", item, method: :delete, data: { confirm: "You sure?" } %></button>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

Aucun commentaire:

Enregistrer un commentaire