Class: Cosmo::Web::Controllers::Batches

Inherits:
Application show all
Defined in:
lib/cosmo/web/controllers/batches.rb

Constant Summary

Constants included from Renderer

Renderer::ASSETS_ROOT, Renderer::VIEWS_ROOT

Instance Method Summary collapse

Methods inherited from Application

#content_for, #hx_request?, #initialize, #params, #path, #render

Methods included from Renderer

#no_content, #not_found, #ok, #redirect_to, #serve, #url_for

Constructor Details

This class inherits a constructor from Cosmo::Web::Controllers::Application

Instance Method Details

#_tableObject



14
15
16
17
# File 'lib/cosmo/web/controllers/batches.rb', line 14

def _table
  limit = (params["limit"] || API::Batch::LIMIT).to_i
  ok render("batches/_table", { batches: API::Batch.all(limit:) })
end

#indexObject



9
10
11
12
# File 'lib/cosmo/web/controllers/batches.rb', line 9

def index
  content_for :title, "Batches"
  ok render("batches/index", layout: true)
end