Displaying 2 results from an estimated 2 matches for "code_id".
Did you mean:
node_id
2006 Aug 04
5
query across tables
I am trying to do things the proper rails way and use the auto generated
id to refernce other tables. Now I''ve hit a wall in trying to write a
query.
timesheets:
id, employee_id, code_id, ... values
codes:
id, job_number, code
How can I show just the timesheets that belong to a specific job?
I would need to check the codes table and look at the jobs, so I was
thinking of something like
Timesheet.find(:all, :order => "employee_id, code_id", :conditions
=>[??] )...
2006 Jul 13
5
Relationships: one model referencing same table for different data sets?
Hi,
After I''ve saved, I want to display the Description from the Codes table that
corresponds with the ID in the Cause table.
Rails doesn''t seem to like that, because on my form, I have two sets of data in
combo boxes that come from the Codes table. So, in the show template, I can''t
do this:
Cause of Death: <%= @cause.code.description %>
Any ideas?
The