Displaying 1 result from an estimated 1 matches for "traceabilitiescontroller".
2007 Nov 19
2
Help with controller and view
...ongs_to :ingredient
belongs_to :recipe
end
class Ingredient < ActiveRecord::Base
has_many :ingredient_recipes
has_many :recipes, :through => :ingredient_recipes
has_many :suppliers
end
class Supplier < ActiveRecord::Base
belongs_to:ingredient
end
The controller
class TraceabilitiesController < ApplicationController
def index
if (params[:BakeryOutput].nil? )
@traceabilities = BakeryOutput.find(:all,:include => [:recipe,
:customer])
else
@traceabilities = BakeryOutput.find(:all, :conditions =>
["salebatchcode LIKE ?", "%#{params[:...