Question

I'm using Rails 3.2.13 and Refinery with Inquiries gem. I needed to add a field to the contact form provided by the Inquiries gem; however, I get this error

     “WARNING: Can't mass-assign protected attributes”

I had read to NOT disable the whitelist in the application.rb. So I did

  config.active_record.whitelist_attributes = false

It still didn't work. So I tried to go ahead and add the attr_accessible to

/config/initializers/refinery/inquiries.rb

  Refinery::Inquiries.configure do |config|
  attr_accessible :location
  end

But now I get this error

/config/initializers/refinery/inquiries.rb:7:in <top (required)>': undefined methodattr_accessible' for main:Object (NoMethodError)

I just need to get this form field to work. Any hints!? Please!?

Was it helpful?

Solution

attr_accessible 

is to be used in a model's definition, not in a block. Which object is your from writing into?

OTHER TIPS

Had to run rake refinery:override model=refinery/inquiries/*

added attr_accesible option in here. Thanks!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top