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 8058265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:17:54+00:00 2026-06-05T09:17:54+00:00

I have a fairly generic question about how to create a shortlist in rails.

  • 0

I have a fairly generic question about how to create a shortlist in rails.

What I currently have is a user and job model where users can register and create/edit jobs etc. What I would like to do is enable users to add jobs they are interested in to a “shortlist” so that they can easily come back to them – I would then want to add these shortlisted jobs to my user dashboard.

I was wondering what would be the best way to implement a setup like this? Would it be best to create a seperate controller for shortlists and make this a nested resource of users and then link my jobs table with my shortlist table in my database?

Would be great to get some ideas from anyone who has implemented anything like this before?

Thanks! 🙂

  • 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-05T09:17:57+00:00Added an answer on June 5, 2026 at 9:17 am

    If I’m understanding correctly, it sounds like you want a has_and_belongs_to_many relationship here as far as the modeling goes –

    User:

    has_and_belongs_to_many :shortlisted_jobs, :class_name => 'Job'
    

    Job:

    has_and_belongs_to_many :shortlisting_users, :class_name => 'User'
    

    As far as the controller setup, I would put the job CRUD into a JobsController, that isn’t namespaced, and add the needed actions for manipulating a particular user’s shortlist into the UsersController.

    The one assumption I’m making is that me, as a user in your app, can add a job that you created to my shortlist. If this is the case, I would set it up how I just described.

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

Sidebar

Related Questions

I have a fairly specific question about concurrent programming in C. I have done
I have a fairly involved managed data model which has a central object with
I have some fairly generic code which uses preprocessor macros to add a certain
I have a fairly generic class (Record) that I have added a callback handler
Scenario: I have a fairly generic table (Data), that has an identity column. The
This is a fairly generic question in that I'm just wondering what potential options
I have a general question and I'm not sure where to begin, literally. Can
I have a fairly simple system, and for the purposes of this question there
I have a fairly generic C# socket server that uses the asynchronous methods of
This is hopefully a fairly straightforward question. I am building a generic search form

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.