ruby on rails - Is it possible to see if there is a parameter whose name matches a given regex? -


i'm speaking of param name, not value. couldn't find on that.

i'd know if there paramater name matches /[a-za-z]+_page/. value not relevant.

is possible?

try following:

params.keys.any? { |key| key.match /[a-za-z]+_page/ } 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -