I have the following setup:
class Option < ActiveRecord::Base has_many :size_prices accepts_nested_attributes_for :size_prices end def new @option = Option.new @sizes = @customization.item.sizes @sizes.each do |size| @option.size_prices.build({:size_id => size.id}) end end <%= f.fields_for :size_prices do |price_form| %> I would like to do something like: <%= Size.find(price_form.size_id).name %> <%= price_form.text_field :amount %> <% end %>
Is there a way to access the size_id of each object using a form? I would like to get the name of the size object.
source share