search for: find_emrec

Displaying 4 results from an estimated 4 matches for "find_emrec".

2006 Mar 05
2
Need help understanding Rails magic!
...Bill ------------------------ controller code ------------------------- class AllergyController < ApplicationController model :emrec model :allergy model :allergy_item def new @allergy_item = find_allergies end def update @allergy_item = find_allergies @emrec = find_emrec ###### # This is the code I don''t understand. My intention was to check the new params entry for each # allergy record to see if it had been deselected. If it had, I''d delete the associated allergy record # I assumed the code below would destroy *all* the...
2006 Mar 09
3
Need help PLEASE!!! - updating collection from form
...someone could help point me in the right direction. I''ve included the view and controller code below. Thanks in advance for any assistance! Bill --------------------- controller code ------------------------ def edit_illnesses # send a collection of records to the view @emrec = find_emrec @illnesses = Illness.find(:all, :conditions => ["emrec_id = ?", @emrec.id]) end def update_illness # update the records sent in ''edit_illnesses'' based on what''s returned in ''params'' @emrec...
2006 Mar 11
2
assignment of parent ID in child''s fk field
When I create a child record I''m not automagically getting the parent ID put into the fk field. Does object.new take parameters that allows me to do that as part of the AR record creation? Or do I need to do it separately? Or am I missing the boat altogether ;-) Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Sep 09
2
Server-side session management for short session expirations?
...n the user explicitly logs out of my app, I delete all the data they''ve entered/that''s been created during their session. The data includes files, database records, and then their session data. The controller code that gets executed when they log out is: def cleanup emrec = find_emrec files = Tempfilerec.find(:all, :conditions => ["emrec_id = ?", emrec.id]) files.each {|file| #FileUtils.rm "#{RAILS_ROOT}/public/#{file.filename}" for production FileUtils.rm "public/#{file.filename}" } emrec.destroy reset_...