I am looking to be able have an ActiveRecord object organized like so:
class Job < ActiveRecord::Base has_many :lines def value ..concat lines together separated by \n end def value=(string) lines = string.split( "\n" ).collect do |value| Line.new( :text =< value ) end end end
and would like to have an a from with an text box that points at the :value attribute and be able to call Job.create(form_data) and have rows created in the lines table. Similarly I would like the text box to be filled with data from the value accessor. Is there a simple way to do this?