Sha256: 2e306b1ae9ae50cc564fb7b5abc0f829f7ed0b20603dccc1f1f34afb4fd14f59
Contents?: true
Size: 1.04 KB
Versions: 29
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module UiBibz::Ui::Ux::Tables class Paginable < UiBibz::Ui::Base include WillPaginate::ActionView def initialize(store, options, html_options = nil) @store = store @options = options @html_options = html_options end # Render html tag def render content_tag :div, @html_options do concat UiBibz::Ui::Ux::Tables::TablePagination.new(store: @store, wrap_form: @options[:wrap_form]).render concat UiBibz::Ui::Ux::Tables::TablePaginationPerPage.new(store: @store, wrap_form: @options[:wrap_form]).render concat tag(:br, class: 'ui-bibz-clear') end end def paginable? @options[:paginable].nil? ? true : @options[:paginable] end private def store raise 'Store is nil!' if @search_field.options[:store].nil? raise 'Store can be created only with "table_search_pagination" method!' if @search_field.options[:store].try(:records).nil? @store ||= Store.new @search_field.options[:store] end end end
Version data entries
29 entries across 29 versions & 1 rubygems