Hi, What will be the query that runs for above association ?
Thank You, Uma Mahesh. On Wednesday, September 5, 2012 9:57:37 PM UTC+5:30, Brian Ekmark wrote: > > Nevermind ... I figured it out. I was stopping too short into the methods. > > Instead of mytasks.title I should have been using mytasks.task.title > > This dug down in the the linked/joined table just fine. > > -Brian > > On Monday, August 27, 2012 1:39:04 PM UTC-5, Brian Ekmark wrote: > >> Greetings -- >> >> I am very new to RoR and I am reaching out for some assistance. I am >> creating a task management web app to practice and I'm not sure if I am >> running into more of a syntax issue or a design issue. The problem I am >> having is that I am trying to reference a task for a specific user. I have >> two seperate tables for both the users and the tasks, but on the task >> create method I also write to a third table which ties the user to the task >> via their own id. I have been able to keep the creation and the destory in >> sync, but the problem is that I'm not sure how to display the contents of >> the task record from the third table which ties the user to the task. Below >> are some specifics if anyone could help me understand this better I would >> greatly appreciate it. >> >> I am trying to link these all together from a home controller. I can find >> the assigned task_id from the reference table, but I don't know how to >> extract the contents of the record: >> >> class HomeController < ApplicationController >> def index >> @mytasks = TaskOwner.where( :user_id => session[:user_id] ) >> end >> end >> Thank you in advance, >> >> Brian >> >> >> >> > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ERvs7_3xKz4J. For more options, visit https://groups.google.com/groups/opt_out.