Finished Sources implementation
This commit is contained in:
@@ -7,7 +7,7 @@ class IngredientsController < ApplicationController
|
||||
|
||||
def index
|
||||
@ingredient = @project.ingredients.new
|
||||
# passing attr for after_initialize
|
||||
# passing attr for Nutrient after_initialize
|
||||
@ingredient.nutrients.new(ingredient: @ingredient)
|
||||
@ingredients = @project.ingredients.includes(:ref_unit)
|
||||
@ingredients << @ingredient
|
||||
|
||||
@@ -39,7 +39,7 @@ class SourcesController < ApplicationController
|
||||
# :find_* methods are called before :authorize,
|
||||
# @project is required for :authorize to succeed
|
||||
def find_source
|
||||
@unit = Source.find(params[:id])
|
||||
@source = Source.find(params[:id])
|
||||
@project = @source.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
|
||||
Reference in New Issue
Block a user