views:

47

answers:

0

Lets say I have something like the following:

class Item
  def initialize
    @description, @price = descr, price
  end
end

class Shop
  def initialize
    @items = []
  end

  def add_item(item)
    @items << item
  end
end

Is there a way to use a 'Shop' object in a form where each 'item' (or a field in the item) is a checkbox and next to it there is a textfield with the price field?