display results with a show more link

Multi tool use


display results with a show more link
I'm trying to figure out a way to always show 5 jobs in my Rails app and then have a link that when clicked will show all of the remaining jobs. Should I do something in my jobs_controller where I'm just getting the first 5 and then getting the rest, or is it better to do it in the view somehow?
<!-- company -->
<div class="vertical-space">
<b>Company Name</b><br />
<div class="sub-text">
<% Job.by_company_count.size.each do |name, count| %>
<div class="indent"><%= link_to name, filtered_jobs_path(company: name) %>
(<%= count %>)
<br>
</div><!--./indent-->
<% end %>
</div><!--./sub-text-->
</div>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.