Getting confused by my associations

Hi All,

I’m working on an application whereby each user will have a dashboard
that will show topics and the associated results for those topics
based on a quiz taken by the user.

The 3 models in question are:

has_many :results

has_many :results
has_many :users, :through => :results

belongs_to :user
belongs_to :topic

On my dashboard view, I have the topics set out but am completely
stuck with placing the current user’s (latest) result for that topic
next to it.

I’m populating a @topics instance variable to iterate over to show the

I’d really appreciate a nudge in the correct direction.



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs