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

Ruby on Rails Add comments

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.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in