In my form i want to generate random strings for the following fields
f.input :lti_api_key, label: "LTI API KEY"
f.input :lti_api_secret, label: "LTI API SECRET"
how can i do that? Please help me...
In my form i want to generate random strings for the following fields
f.input :lti_api_key, label: "LTI API KEY"
f.input :lti_api_secret, label: "LTI API SECRET"
how can i do that? Please help me...
Take a look at the string_pattern gem project: https://github.com/MarioRuiz/string_pattern
To install it: gem install string_pattern
This is an example of use:
require 'string_pattern'
# four characters. optional: capitals and numbers, required: lower
"4:XN/x/".gen # aaaa, FF9b, j4em, asdf, ADFt