app/controllers/entities/leads_controller.rb
def filter
    session[:leads_filter] = params[:status]
    @leads = get_leads(page: 1, per_page: per_page_param) # Start one the first page.

    respond_with(@leads) do |format|
      format.js { render :index }
    end
  end
# POST /leads/filter                                                     AJAX
#----------------------------------------------------------------------------
POST /leads/filter                                                     AJAX
POST / leads / filter AJAX
def filter
    session[:leads_filter] = params[:status]
    @leads = get_leads(page: 1, per_page: per_page_param) 
    respond_with(@leads) do |format|
      format.js { render :index }
    end
  end
def filter session [ :leads_filter ] = params [ :status ] @leads = get_leads ( page : 1 , per_page : per_page_param ) respond_with ( @leads ) do | format | format . js { render :index } end end
POST /leads/filter                                                     AJAX
POST / leads / filter AJAX
# Start one the first page.