Ruby – Passing Blocks To Methods

The code by David will work fine, but this is an easier and shorter solution: foo = Proc.new { |prompt| prompt.echo = false } new_pass = ask(“Enter your new password: “, &foo) verify_pass = ask(“Enter again to verify: “, &foo) You can also use an ampersand to assign a block to a variable when defining … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)