Module: SmartListing::Helper::ControllerExtensions
- Defined in:
- app/helpers/smart_listing/helper.rb
Instance Method Summary collapse
- #_prefixes ⇒ Object
- #smart_listing(name) ⇒ Object
-
#smart_listing_create(*args) ⇒ Object
Creates new smart listing.
Instance Method Details
#_prefixes ⇒ Object
31 32 33 |
# File 'app/helpers/smart_listing/helper.rb', line 31 def _prefixes super << 'smart_listing' end |
#smart_listing(name) ⇒ Object
27 28 29 |
# File 'app/helpers/smart_listing/helper.rb', line 27 def smart_listing name @smart_listings[name.to_sym] end |
#smart_listing_create(*args) ⇒ Object
Creates new smart listing
Possible calls: smart_listing_create name, collection, options = {} smart_listing_create options = {}
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/smart_listing/helper.rb', line 9 def smart_listing_create *args = args. name = (args[0] || [:name] || controller_name).to_sym collection = args[1] || [:collection] || smart_listing_collection if (view_context.respond_to?(:smart_listing_config_profile)) = {:config_profile => view_context.smart_listing_config_profile}.merge() end list = SmartListing::Base.new(name, collection, ) list.setup(params, ) @smart_listings ||= {} @smart_listings[name] = list list.collection end |