Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination for a custom index View #442

Open
iCueto opened this issue Mar 3, 2023 · 0 comments
Open

Pagination for a custom index View #442

iCueto opened this issue Mar 3, 2023 · 0 comments

Comments

@iCueto
Copy link

iCueto commented Mar 3, 2023

Hello,

I'd like to have pagination for a custom index view my code looks like this:

index view:

= content_for(:title, 'Inventories')
= render "header"

.main-content-area
  .main-content-container
    .main-content
      .row
        - @grouped_inventories.each do |product|
          .col-md-12
            = render "admin/sync/inventories/inventories_table", product: product

controller on admin:

controller do
    def index
      @grouped_inventories = Sync::Product.includes(:inventories).all

      toolbar(:primary, {clear: true}) do |toolbar|
        toolbar.link 'Add', new_sync_inventories_admin_path, class: 'btn btn-primary', icon: 'fa fa-plus'

        toolbar.dropdown 'Actions', class: 'btn btn-secondary' do |dropdown|
          dropdown.link 'Sync', "#", method: :post, icon: 'fa fa-sync'
        end
      end
    end
  end
  

Is it possible to make a custom pagination?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant