Hi there:
I’m playing around with a form that saves name, type and date for a
kind of travels. At the controller I have this:
@promotion = Promotion.new(params[:promotion])
@promotion.save
redirect_to promotions_path
So yes, I mass-assign all the form data, but my model definition is
empty actually (no “attr_protected”, no “attr_accessible” anywhere),
but the message “WARNING: Can’t mass-assign these protected
attributes: type” shows up every time and the value for “type” gets
saved as empty (NULL) on development environment.
I’ve found this thread at the group but it doesn’t solve my problem:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/fe5263558f73a514/ecee69cdf4676123?lnk=gst&q=Can’t+mass-assign+these+protected+attributes#ecee69cdf4676123
Any ideas about what is protecting this attribute from myself?.
Cheers, Ibon.