search for: facility_id

Displaying 8 results from an estimated 8 matches for "facility_id".

2006 Feb 23
4
looping
I have a form that prints fine for one particular criteria... facility_id = "X" controller code looks like this... def fac_log @facility = Facility.find(params[:report][:facility_id]) @placement = Placement.find(:all, :conditions => [ "facility_id = ? and discharge_date IS NULL, params[:report][:facility_id] ] ) end I c...
2006 Feb 18
1
sql logic is killing me
I know my thinking is sloppy. I want to know how many clients currently in my facility are male... My facilities_controller.rb def list_fac @placement_pages, @placements = paginate( :placements, :conditions => ["placements.facility_id = ?", params[:facility_id] ], :include => [:facility, :client], :order_by => ''facilities.name, clients.last_name, :per_page => 14) @facility = Facility.find(:first, :conditions => ["id = ?", params[:facility_id] ]) @beds_to...
2007 Oct 25
1
find - group - postgres
I am not sure that this is entirely a rails question as I am trying to run the command in postgres and I am getting the same error... controller code... @client_slot_count = ClientSlotsDaily.find(:all, :conditions => ["created_at > ? AND created_at < ? AND facility_id = ? AND client_id IS NOT NULL", starting_date, ending_date, @facility.id], :group => ''client_id'') error reported is... PGError: ERROR: column "client_slots_dailies.id" must appear in the GROUP BY clause or be used in an aggregate function : SE...
2006 Feb 28
2
sorting collection lists
...ort them by one or two of the columns as the lists are getting long enough to make a difference. <%= options = [[''Select a Facility'', '''']] + @facility.collect { |fac| [fac.name, fac.id] } select ''placement'', ''facility_id'', options %> how do I get this to order by facility.name ? Craig
2012 Apr 23
1
Searching and returning arrays
...it_tag "Search", :name => nil%> (...) <% @hotels.each do |hotel|%> <h2> <%= link_to hotel.name, hotel %> </h2> My hotels and facilities are a has_many_and_belongs_to relationship with everything working. The facilities_hotels table is created with the facility_id and hotel_id collums, and the facilities table has for columns a facility_id and description(which is for e.g. pool, 24hroom service etc) The issue is in my model: def self.search(params) if params arel = where(''#searches for names/location/rating'') if...
2006 Mar 07
6
form_tag - directing to new target window
How do I use... <%= link_to "All Facilities", :action => ''fac_log_all'' %> if I add :target => "_new" that is just a parameter and not a directive. I just want reports to print into a separate window. How do I do that? It''s not clear at all to me Craig
2006 Mar 16
32
iterating a partial with :collection
following AWDWR book - ''Partials and Collections'' (rather sparse info there too) and I might add that the wiki page on this topic is entirely devoid of any info...be that as it may... I have hash of several arrays that I want to iterate though and display. the first hashed element looks like this (greatly simplified) - :facility: !ruby/object:Facility attributes:
2006 Mar 25
1
foreign keys on migration
...er FOREIGN KEY (case_manager_id) REFERENCES case_managers(id)'' execute ''ALTER TABLE ONLY placements ADD CONSTRAINT fk_cp_client FOREIGN KEY (client_id) REFERENCES clients(id)'' execute ''ALTER TABLE ONLY placements ADD CONSTRAINT fk_cp_facility FOREIGN KEY (facility_id) REFERENCES facilities(id)'' execute ''ALTER TABLE ONLY placements ADD CONSTRAINT fk_cp_case_manager FOREIGN KEY (case_manager_id) REFERENCES case_managers(id)'' execute ''ALTER TABLE ONLY referral_notes ADD CONSTRAINT fk_cp_placement FOREIGN KEY (placement_i...