app/controllers/concerns/smart_listing_manager.rb
# ============================================================================
# Logic ======================================================================
# ============================================================================
# manage_smart_listing takes an array of keys which name private methods in the form of 'list_resource_name'
# Create lists in this form and include the instance variable '@list' in the smart_listing_update
# Doing this ensures that ajax requests do not clash with smart_listing
Logic
manage_smart_listing takes an array of keys which name private methods in the form of 'list_resource_name'
Create lists in this form and include the instance variable '@list' in the smart_listing_update
Doing this ensures that ajax requests do not clash with smart_listing
Logic manage_smart_listing takes an array of keys which name private methods in the form of ' list_resource_name ' Create lists in this form and include the instance variable ' @list ' in the smart_listing_update Doing this ensures that ajax requests do not clash with smart_listing
def manage_smart_listing(*methods)
    respond_to do |format|
      format.html do
        methods.each do |method|
          send("list_#{method.to_s}".to_sym)
        end
      end
      format.js do
        params.keys.each do |key|
          if key.last(7) == "listing"
            name = key.chomp("_smart_listing")
            send("list_#{name}".to_sym)
            @list = name.to_sym
          end
        end
      end
    end
  end
def manage_smart_listing ( * methods ) respond_to do | format | format . html do methods . each do | method | send ( "list_#{method.to_s}" . to_sym ) end end format . js do params . keys . each do | key | if key . last ( 7 ) == "listing" name = key . chomp ( "_smart_listing" ) send ( "list_#{name}" . to_sym ) @list = name . to_sym end end end end end
Logic
manage_smart_listing takes an array of keys which name private methods in the form of 'list_resource_name'
Create lists in this form and include the instance variable '@list' in the smart_listing_update
Doing this ensures that ajax requests do not clash with smart_listing
Logic manage_smart_listing takes an array of keys which name private methods in the form of ' list_resource_name ' Create lists in this form and include the instance variable ' @list ' in the smart_listing_update Doing this ensures that ajax requests do not clash with smart_listing
methods
<not_specific>