How to show applicants list according to posted jobs id

I am a newbie in ruby on rails it’s also my first ruby application.

I applied for a job according to posted_jobs_id as a jobseeker and
applied successfully.

Now I am a recruiter want to show specific applicants for specific
posted_jobs_id, but it’s showing whole applicants when I click for
specific posted_jobs_id anyone can help me, please how can I write a
logic or solution for this?

My view file code:

    <% @applicants_view.each do | applicants | %>
           <a href="<%= user_path(:jobseeker_id =>

applicants.jobseeker_id) %>">
<%= applicants.jobseeker.try(:first_name) %>

<%= applicants.jobseeker.try(:year_of_experience) %>
          <%= applicants.expected_salary %>

    <% end %>

Thanks in Advanced for all!

I solved this question! Want to share with the ruby community because it
will be helpful for others.

I added in my controller:

@applicants_view = AppliedJob.where(:posted_jobs_id =>


My view file is same as question code.