Module: RailsBootstrapWidgets::FiltersHelper

Defined in:
app/helpers/rails-bootstrap-widgets/filters_helper.rb

Instance Method Summary collapse

Instance Method Details

#filters_widget(items, options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'app/helpers/rails-bootstrap-widgets/filters_helper.rb', line 13

def filters_widget(items, options = {})
	if (options = _prepare(options)).present?
		form_tag(url_for("/"), method: :get, id: :filters, class: :span8) do
      	(_selector(:filter, options[:filters], options[:filter]) << _selector(:order, options[:orders], options[:order]) << _reset << _reload).html_safe
    	end
    else
    	""
	end << pagination_widget(items, class: :span4)
end

#pagination_widget(items, options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'app/helpers/rails-bootstrap-widgets/filters_helper.rb', line 5

def pagination_widget(items, options = {})
	if items.present?
		(:aside, (options[:class].to_s.present? ? { class: options[:class] } : {})) do
			will_paginate(items, inner_window: 0, outer_window: 0).html_safe
		end
	end
end