How to filter parameters in rails?

前端 未结 5 719
南笙
南笙 2020-12-13 12:03

Rails has built in log filtering so you don\'t log passwords and credit cards. Works great for that but when you want to trigger a custom log (like to email) and send your

5条回答
  •  没有蜡笔的小新
    2020-12-13 12:57

    You can always use the except method:

    params.except(:password, :password_confirmation, :credit_card)
    

    That will exclude them from the listing. To "filter" them you could try this approach.

提交回复
热议问题