Oh my. Turns out the problem was not lying in the model, but in the controller... I forgot to add a simple line in the update
method to assign my POST value to my class field...
Anyway, final solution is this :
In my controller :
def update
@a.whatever = params[:a][:whatever]
@a.my_b = params[:a][:my_b]
@a.save
end
In my model :
class A < ActiveRecord::Base
has_many :B
attr_accessible :whatever
def my_b
list = ""
self.B.each do |b|
list += "#{b.name}\n"
end
list
end
def my_b=(value)
# parse the value and save the elements
end
end