I have a hackish sort of setup in which I am displaying some information on a list of companies and then clicking one of those company names displays a list of all leads generated for that company. I accomplished this by passing the company_id through the params. This works beautifully and I can search and filter to my heart's content until I click 'Clear Filters' and it strips everything, including the company_id. The result is an Oops page, because the system doesn't have a company_id to use to generate the list of leads.
I attempted something like this in the controller for that page
after filter: company_id, :only => :index
def franchise_id
params.merge({:franchise_id => params[:franchise_id]})
end
but this only injects the ID back in after I filter something, and not after 'Clear Filters' was clicked.
Is there a way to override the 'Clear Filters' behavior for just this page and force it to save the company_id?