Adding/deleting nutrients on ingredient form working
This commit is contained in:
@@ -5,7 +5,7 @@ class Ingredient < ActiveRecord::Base
|
||||
|
||||
belongs_to :project
|
||||
has_many :nutrients
|
||||
accepts_nested_attributes_for :nutrients
|
||||
accepts_nested_attributes_for :nutrients, allow_destroy: true
|
||||
|
||||
validates :project, associated: true
|
||||
validates :name, presence: true, uniqueness: {scope: :project_id}
|
||||
|
||||
Reference in New Issue
Block a user