Arrays in model objects


#1

Having a dumb model object like

def MyModel
attr_accessor :property

def initialize
@property = Array.new
end
end

when it is used for for interaction by “@object = MyModel.new” and then
used in view as

<%= text_field ‘object’, ‘property’ %>

shoudn’t it be rendered as?:

that is with [] at the end so params[:property] will gain array?


Kamil


#2

<%= text_field ‘object’, ‘property’ %>

shoudn’t it be rendered as?:

Should it be

<%= text_field ‘object’, @property %>

?

Tony