Thanks Andrew, but I couldn't make the 'find' work on the
'PeopleSkill.where...' line.  When I used 'find' on the @people_skill
line it came very close (since in the controller, listed above,
people_skill was already choosing the field 'skill'), so when I used:
 <%= @people_skill.find(@person.id)
and skipped the next line listed above, the SQLException was
SQLite3::SQLException: near ".": syntax error: SELECT  skill FROM
"people_skills" WHERE "people_skills"."id" = 23 AND (:people_id =
@person.id) LIMIT 1
which is VERY close to what I want, except that I want
"people_skills"."people_id"=23, not "people_skill"."id"=23.  I know
that 'find' always looks for the 'id' so I've got to get a different
variation.
What changes should I make?
     Thanks again,
            Barney


On Jul 18, 10:14 pm, Andrew Skegg <[email protected]> wrote:
> Barney <bsperlin@...> writes:
>
> > <p>
> >   <b>Skill</b>
> >   <%= @people_skill.build.skill %>
> >   <%= PeopleSkill.where("people_id = @person.id")%>
> >  </p>
>
> > which produced the strange #<ActiveRecord... output above.  Other
> > guesses have either given me errors or no output at all, so please
> > tell me the right way to do this.
> >              Barney
>
> PeopleSkill.where("people_id = @person.id") will return an ActiveRecord
> relation object, rather that execute the query againstg the database.  Try:
> PeopleSkill.where("people_id = @person.id").find

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to