Я пытаюсь использовать smart_listing gem для извлечения данных из таблицы.Но у меня есть несколько вопросов.Я понимаю, что у меня нет ошибок, только когда я удаляю следующие строки из моего «views / layouts / application.html.erb».
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag "application" %>
Но тогда это испортит все мое приложение.Кто-нибудь знает способ обойти?Кажется, у этого драгоценного камня много проблем.
мой контроллер выглядит так:
class DistribsController < ApplicationController
include SmartListing::Helper::ControllerExtensions
helper SmartListing::Helper
def index
smart_listing_create :contacts, Contact.all, partial: "distribs/list"
end
end
my _list.html.haml выглядит так:
- unless smart_listing.empty?
%table.table.table-striped
%thead
-# Second argument of sortable is sorted attribute name
%th.col-md-3= smart_listing.sortable "Name", "name"
%th.col-md-3= "Phone"
%th.col-md-4= smart_listing.sortable "Location", "location"
%th
%span.glyphicon.glyphicon-shopping-cart{title: "Has credit card?"}
%th.col-md-2= smart_listing.sortable "Wallet saldo", "saldo"
%tbody
- smart_listing.collection.each do |o|
%tr
-# User row goes here...
= smart_listing.paginate
= smart_listing.pagination_per_page_links
- else
%p.warning No records!
index.html.haml выглядит так:
= smart_listing_render: контакты index.js.erb выглядит так:
<%= smart_listing_update :contacts %>