Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:43:06+00:00 2026-06-12T07:43:06+00:00

This should be something simple but I’ve been at it for a day now

  • 0

This should be something simple but I’ve been at it for a day now and can’t see a clear answer.

I have three basic models: User, Evaluation and Job. Users work on the job and the job owner evaluates the users. A user can have many various jobs. Each job will evaluate its related users multiple times (within the job, each related user will have the same evaluations – with different scores, of course.)

So, simply, I would like to present the data in tabular form (kind of like an excel workbook) with the evaluation name going across the x axis and the user names going down the y axis.

So, it would look like this:

        Evaluation 1  |  Evaluation 2  |  Evaluation 3
       _______________________________________________________
User 1   Good              Poor            Outstanding
User 2   Poor              Good            Good

I can easily show the labels across either the x OR the y but not both.

Q1) Each Job/User Evaluation is its own db record. Any suggestions as to how I would structure the the LABELS across the x and y axis?

Q2) How would I ensure the data (for example, User 2 Evaluation 3) is categorized (plotted) correctly? And, what if a new User (e.g., User 3) joins the job late and doesn’t have Evaluation 1 or Evaluation 2…

Any and all suggestions are welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:43:07+00:00Added an answer on June 12, 2026 at 7:43 am

    One way of doing it is to create an array of hashes, each hash containing user rating and an array of all available evaluations, something like

    Evaluation.where(:job_id => 1)order('title').map{|e| e.title}.uniq
    

    This will give you something similar to all_evaluations:

    all_evaluations = ['eval1', 'eval2', 'eval3', 'eval4']
    

    User evaluations hash would look something like this:

    user_evaluations = {"UserA"=>{:eval1=>1, :eval3=>3}}, {"UserB"=>{:eval1=>1, :eval=>3}}
    

    all_evaluations will be used for header row labels and for pulling evals for each user records:

    <tr>
    <% all_evaluations.each do |eval_header| %>
      <td><%= eval_header %></td>
    <% end %>
    </tr>
    
    <% user_evaluations.each do |user| %>
      <tr>
        <td><%= user.keys %></td>
        <% all_evaluations.each do |eval| %>
          <td><%= user.values.first[eval.to_sym] %></td>
        <% end %>
      </tr>
    end
    

    There might be few bugs/changes here, but it should work in principal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be pretty simple, still I can not see what/how something could be
This is frustrating me. It should be something really simple but I can't get
I feel this should be simple but I can't find an answer. I want
This should be simple enough but something's gotten me big time. All I have
This should be pretty simple but it's not working. I have a file underneath
This seems like something simple but I can't seem to get it to work.
Probably the fix of this should be something simple, but I just cant find
Seems like this should be something straightforward, but I haven't been able to get
This should be simple but I guess I'm hitting a mental block- I have
This should be so simple but I must be missing something obvious. Table: id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.