Displaying 4 results from an estimated 4 matches for "pgm_updat".
Did you mean:
pgm_update
2006 Mar 04
5
has_many and belongs_to example?
Hi!
If i have 2 tables i.e. product and images and product has_many images,
image belongs_to product - how to create _form.rhtml, new/create and
edit/update methods in product controller, so in a single form i can add
one product and MANY (let''s assume for now that this number is fixed)
images for this product?
Pleeeeease help me :)
--
Posted via http://www.ruby-forum.com/.
2006 Mar 13
2
relationship woes
I have two tables:
class PgmUpdate < ActiveRecord::Base
has_many :pgm_visits, :foreign_key => ''pgm_update_fk''
...
and
class PgmVisit < ActiveRecord::Base
belongs_to :pgm_update, :foreign_key =>
''pgm_update_fk'', :dependent => true
...
According to the has_many docs (http://api.rubyonrails.org/classes/
ActiveRecord/Associations/ClassMethods.html#M000471)
collec...
2006 Mar 14
1
Where to validate?
class PgmUpdate < ActiveRecord::Base
has_many :pgm_visits
...
class PgmVisit < ActiveRecord::Base
belongs_to :pgm_update
...
I am trying to make sure that none of the visits in PgmUpdate overlap
start and end dates. Should this validation exist in PgmUpdate or the
controller? It seems natural to put them in PgmUpdate, but I must
force the relationship together because there is no PgmVisit.id until
the re...
2006 Apr 21
0
model modules
...asn''t available..." as mentioned in the book.
2. The book says I must tell the controller which models to load, but
how do you do that with a model in a module?
I presume like this:
class Activities::Programs::ApplyController < ApplicationController
model ''prod_record/pgm_update/client''
...
But without any feedback I cannot tell if I am doing it right. Can
anyone help? Can I get an example of a modularized model that I can
look at?
-John
--
John Smilanick
Computing Staff - Webmaster
Kavli Institute for Theoretical Physics
University of California, Santa Ba...