Posted by daviddavis on September 18, 2013
The params hash contains all the data that was submitted from a request. If you modify it, later code won't have access to it. Instead, copy the params hash and modify the copy.
Don't modify the params hash.
def search params.except!(:action, :controller) @search = User.search(params) render "search" end
Supposing someone later would add code to the end of this action that needed params[:action] or params[:controller], they would have to refactor your code.
Instead copy the params hash.
def search filter = params.except(:action, :controller) @search = User.search(filter) render "search" end