Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Created October 14, 2012 19:17
Show Gist options
  • Select an option

  • Save aalvesjr/3889535 to your computer and use it in GitHub Desktop.

Select an option

Save aalvesjr/3889535 to your computer and use it in GitHub Desktop.
Como tratar o /edit com accepts_nested_attributes_for ???
class Release < ActiveRecord::Base
attr_accessible :category_id, :code, :description, :first_paid, :fixed_payment, :name, :number_instalments, :total_amount, :instalments_attributes
has_many :instalments
accepts_nested_attributes_for :instalments
end
__END__
Como montar o formulario para edição que na mesma tela vai ter os atributos de Release e das Instalments sem ter que especificar todos os names e id's na mão?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment