Dirk Bergmann

Developer, panographer. Does consultancy work from own company. Lives in Chiang Mai, Thailand.

Twitter

Chiang Mai

Hua Hin

Thailand Hotels

ListVote - List. Vote. Learn.

Partnerseek - Find Partners

Can't mass-assign these protected attributes: captcha_key, captcha

If you have trouble getting simple_captcha to work with your Rails application, i.e. you enter the correct captcha string but still get the

?Secret Code did not match with the Image?

or similar error, look for this error in your log:

Can?t mass-assign these protected attributes: captcha_key, captcha.

To solve this issue, you?ll have to add

attr_accessible :captcha, :captcha_key

to your model. Here?s how to test simple_captcha.