Sha256: 301a39dd1ef1f0f0ec979e4230c54da399c83b7ad0ca64e9cab74c9885099a79
Contents?: true
Size: 987 Bytes
Versions: 14
Compression:
Stored size: 987 Bytes
Contents
module UiBibz::Ui::Ux 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::TablePagination.new(store: @store).render concat UiBibz::Ui::Ux::TablePaginationPerPage.new(store: @store).render concat tag(:br, class: 'ui-bibz-clear') end end def paginable? @options[:paginable].nil? ? true : @options[:paginable] end private def store @store ||= if @search_field.options[:store].nil? raise 'Store is nil!' elsif @search_field.options[:store].try(:records).nil? raise 'Store can be created only with "table_search_pagination" method!' else Store.new @search_field.options.delete :store end end end end
Version data entries
14 entries across 14 versions & 1 rubygems