Changing the params before update - rails
<p>I have a update method that has dynamic incoming parameters in order to update the attributes I'd first like to change the params. This is hard to explain so I'll post some code and try to step through it.</p>
<h2>Update Method:</h2>
<pre><code>    def update
    @integration = current_account.integrations.find(params[:id])
    
    attrs = params.require(:integration_webhook).permit(:filters)

    if @integration.update_attributes(attrs)
      flash[:success] = &quot;Filters added&quot;
      redirect_to account_integrations_path
    else
      render :filters
    end
  end
</code></pre>
<p>The requires key is a dynamic parameter because sometimes it's integration_webhook and other times it's  integration_pager_duty. So, I'd like to strip it of its integration type so I can just require integration like so <code>attrs = params.require(:integration).permit(:filters)</code>. How can I handle dynamic params when trying to update? Because it's hardcoded I'll get this error if it changes <code>param is missing or the value is empty: integration_pager_duty</code></p>