Skip to content

Mass Assignment whitelisting with Rails 3.x

k33l0r edited this page Apr 18, 2012 · 1 revision

In Rails 3.2.3 (and above), you have to whitelist the variables humanizer_answer and humanizer_question_id with attr_accessible, otherwise creating a new entry fails. For example:

class Post < ActiveRecord::Base
  include Humanizer
  attr_accessible :name, :humanizer_answer, :humanizer_question_id
  require_human_on :create
end