Module: Searchgasm::Helpers::ControlTypes::Select
- Defined in:
- lib/searchgasm/helpers/control_types/select.rb
Overview
Select Control Types
These create <select> tags to help navigate through search data. This is here as an alternative to the Links control types.
Instance Method Summary collapse
-
#order_as_select(options = {}) ⇒ Object
Please see order_as_links.
-
#order_by_select(options = {}) ⇒ Object
Please see order_by_links.
-
#page_select(options = {}) ⇒ Object
Please see page_links.
-
#per_page_select(options = {}) ⇒ Object
Please see per_page_links.
Instance Method Details
#order_as_select(options = {}) ⇒ Object
Please see order_as_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
15 16 17 18 |
# File 'lib/searchgasm/helpers/control_types/select.rb', line 15 def order_as_select( = {}) add_order_as_select_defaults!() searchgasm_state() + select([:params_scope], :order_as, [:choices], [:tag], [:html]) end |
#order_by_select(options = {}) ⇒ Object
Please see order_by_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
9 10 11 12 |
# File 'lib/searchgasm/helpers/control_types/select.rb', line 9 def order_by_select( = {}) add_order_by_select_defaults!() searchgasm_state() + select([:params_scope], :order_by, [:choices], [:tag], [:html] || {}) end |
#page_select(options = {}) ⇒ Object
Please see page_links. All options are the same and applicable here, excep the :prev, :next, :first, and :last options. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
27 28 29 30 |
# File 'lib/searchgasm/helpers/control_types/select.rb', line 27 def page_select( = {}) add_page_select_defaults!() searchgasm_state() + select([:params_scope], :page, ([:first_page]..[:last_page]), [:tag], [:html]) end |
#per_page_select(options = {}) ⇒ Object
Please see per_page_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
21 22 23 24 |
# File 'lib/searchgasm/helpers/control_types/select.rb', line 21 def per_page_select( = {}) add_per_page_select_defaults!() searchgasm_state() + select([:params_scope], :per_page, [:choices], [:tag], [:html]) end |