RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: dedek
Hi everyone, I had a problem with my Nested Model From, I am not sure what did I do wrong,
<%= simple_form_for @project do |p| %> <%= p.input :name %> <%= p.input :description %> <%= p.simple_fields_for :tasks do |task| %> <%= task.input :description %> <% end %> <%= p.button :submit %> <% end %>
class Project < ActiveRecord::Base attr_accessible :description, :name, :tasks_attributes has_many :tasks accepts_nested_attributes_for :tasks, :reject_if => :all_blank, :allow_destroy => true end
class Task < ActiveRecord::Base belongs_to :project attr_accessible :description, :done end
When I try to render the from, the nested form field does not appear. Is there any problem with my codes ?
Hi everyone, I had a problem with my Nested Model From, I am not sure what did I do wrong,
When I try to render the from, the nested form field does not appear. Is there any problem with my codes ?