ruby on rails - Undefined method `javascript_link_tag' -
im sure simple fix i've been on problem 2 hours now.
all im trying load user index view has boostrap table. in view have loading js files.
when try try access through broswer receive error.
anyone have clues how fix , have js files load?
undefined method `javascript_link_tag'
here 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 |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>
try
<%= javascript_include_tag 'datatables.bootstrap.js' %> <%= javascript_include_tag 'jquery.datatables.min.js' %> <%= javascript_include_tag 'jquery-1.11.1.min.js' %>
instead.
Comments
Post a Comment