I was just reading a blog article and noticed that the author used tap in a snippet something like:
tap
user = User.new.tap do |u| u.username = \
In rails we can use tap to whitelist parameters explicitly:
def client_params params.require(:client).permit(:name).tap do |whitelist| whitelist[:name] = params[:client][:name] end end