RailsCasts Pro episodes are now free!

Learn more or hide this

Neil Matatall's Profile

GitHub User: oreoshake

Site: neil.matatall.com

Comments by Neil Matatall

Avatar

Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:

Something.create(params[:something]) do |thing|
  thing.attr = params[:something][:attr] 
end

while I realize that seems silly, it's better than the alternative :)

Avatar

Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:

Something.create(params[:something]) do |thing|
  thing.attr = params[:something][:attr] 
end

while I realize that seems silly, it's better than the alternative :)