rails/strong_parameters — pull request #21 by tjschuck (2012-04-11 20:37:48+00:00)
Title: Add regex support for permitting params

Instead of explicitly enumerating all permitted params as symbols, allow for regexes:

params.permit(/^company_\d$/ => [:name, :location, /^quarter_\d_profit$/])

This also helps when using ActionView DateHelper methods. Instead of:

params[:account].permit(:"trial_til(1i)",
:"trial_til(2i)",
:"trial_til(3i)",
:"trial_til(4i)",
:"trial_til(5i)")

you can more tersely use something like:

params[:account].permit(/^trial_til/)

(See [pull request #17](https://github.com/rails/strong_parameters/pull/17) for an alternate but less flexible solution to the DateHelper problem.)